How to do this? I read that it is done in event.
Do you want it so that if you press enter in your textbox it will click a button for you?
If so you can use the following:
private void txtBox_keyDown(object sender, KeyEventArgs e)
if (e.KeyValue == 13) //13 = enter
If this is not what you want you should clarify your question.
Alternativley, set the forms AcceptButton property to the button you want to execute on Enter.
Setting the forms CancelButton property will do the same thing for Escape.
And setting the forms HelpButton captures the F1 key.
Your can use this code:
private void TextBox1_KeyPress(object sender, KeyPressEventArgs e)
String key = Convert.ToString(e.KeyChar);
if (key == "r")// r notifies return key
Edited 4 Years Ago
by Nick Evan: Fixed formatting
I used the acceptbutton property. Thanks
I've never been a fan of readme files. They are fine for project files where you will likely need note of building an application, or for distribution packages where you ...
I have a DGV (dgvListOfJobs), populated from an SQL database to show the user a list of 'jobs' (i.e. rows). I also show 7 other DGV's (dgvMonday, dgvTuesday, etc) ...
I was wondering if it was possible to create a software like visual studio (in addition simple, obviously). We could program in vb.net, c ++, etc.