I want to execute the code behind my Search Button by pressing Enter. I have the Accept Button property to my search button. However, when i place my button as NOT vi
You can handle the keydown event of your TextBox control.
TextBox
private void textBox1_KeyDown(object sender, KeyEventArgs e) { if(e.KeyCode==Keys.Enter) buttonSearch_Click(sender,e); }
It works even when the button Visible property is set to false
Visible
false