Solved

Default button

Posted on 2004-08-23
2
211 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 125 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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 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