text field enter event code example Example: windows form textbox enter key event if (e.KeyCode == Keys.Enter) { }