I tried this code:
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (Convert.ToInt32(e.KeyChar) == 13) { MessageBox.S
Try this:
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { switch (e.Key.ToString()) { case "Return": MessageBox.Show(" Enter pressed "); break; } }