Instead, use the event KeyDown:
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Return)
{
}
}
If for some reason this should be KeyPress, you can use (char)13either '\r'for your verification, although I doubt it will work well on non-Windows OS.
if (e.KeyChar == '\r')
Keys.Return char, bitflag ASCII.