Oct 28, 2011

How to set default accept button of Windows form?

There is a property of form is AcceptButton,
If this is set, the button is 'clicked' whenever the user pressed the 'ENTER' Key.
You just set the name of that button which you want to fire default when you press the 'ENTER' Key
Example:-
Form1.AcceptButton = Button1;

Or,
You can also set it by property window of form.

No comments: