how to fire button1_click event while pressing enter key
-
hello, my problem is that i am working on a window app in c#. i have three buttons on my form.now while selecting with tab button i want to fire button1_click or button2_click event when we press enter.for 1 button it can be easily done by form's accept button property .but :zzz: how can i do it for all
-
hello, my problem is that i am working on a window app in c#. i have three buttons on my form.now while selecting with tab button i want to fire button1_click or button2_click event when we press enter.for 1 button it can be easily done by form's accept button property .but :zzz: how can i do it for all
If any button is focused and you press enter, its click event is automatically fired.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Expect everything to be hard and then enjoy the things that come easy. (code-frog) -
hello, my problem is that i am working on a window app in c#. i have three buttons on my form.now while selecting with tab button i want to fire button1_click or button2_click event when we press enter.for 1 button it can be easily done by form's accept button property .but :zzz: how can i do it for all
Hi, First I will apologise for not answering your exact question but here is another way to achieve your goal. Did you know that the standard windows keyboard method for simulating a keypress on the button that has focus is the space bar. Change focus from button to button with the tab key and then use space to press the button, no programming required on your part! Alan.