Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Default button

Posted on 2004-08-23
2
Medium Priority
?
217 Views
Last Modified: 2012-05-05

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
Comment
Question by:bfeddish
  • 2
2 Comments
 
LVL 14

Accepted Solution

by:
ptakja earned 500 total points
ID: 11871520
On your form, set the AcceptButton property to the name of your OK button.
0
 
LVL 14

Expert Comment

by:ptakja
ID: 11871541
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Integration Management Part 2

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question