Hi everyone,
I am making a windows application in which I want that when user presses enter key while textBox1 has focus then an event is generated. I tried using following but it doesn't workout:-
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.GetHashCode() == Keys.Enter.GetHashCode())
MessageBox.Show("Enter key has been pressed");
}
Please help.