• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

Default button


I've got an OK and Cancel button on my VB.NET form and I want my OK button to be the default pushbutton, i.e. press <enter> to accept. I'm sure this one is staring me in the face but I cannot seem to find where I make a button the default.

0
bfeddish
Asked:
bfeddish
  • 2
1 Solution
 
ptakjaCommented:
On your form, set the AcceptButton property to the name of your OK button.
0
 
ptakjaCommented:
There is also a CancelButton property that will trigger the Cancel button click_event to fire when the user closes the window using the Close Window icon (or I think presses the ESC key).
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now