Link to home
Start Free TrialLog in
Avatar of jtran007
jtran007

asked on

winform - default button

Hi,
I have a winform which has one button. How can I set as a default button
whenever user selects space bar or enter key?

Thanks,
JT
Avatar of p_davis
p_davis

for enter key set the dialogresult OK Form Property to that button

otherwise you will have to enter the message pump to handle other keys
sorry set the Accept button property to your preferred button
ASKER CERTIFIED SOLUTION
Avatar of Mez4343
Mez4343

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
which is effectively exactly what i just illustrated
Avatar of jtran007

ASKER

Thanks,
JT