473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

"Default" Command Button?

Is it possible to set a command button to the "default" button of the
form?

Here's an example of what I mean -- press Start -> Run. Notice that
the "OK" button has a dark rectangle around it, and when you press
ENTER, this "OK" button's Click event handler is eventually fired.

I was expecting Button to have a Default property, but can't seem to
find anything like it...
Nov 15 '05 #1
3 5546
Set the .AcceptButton property of the form to the button that you want to be
the default
"C# Learner" <cs****@learner.here> wrote in message
news:3n********************************@4ax.com...
Is it possible to set a command button to the "default" button of the
form?

Here's an example of what I mean -- press Start -> Run. Notice that
the "OK" button has a dark rectangle around it, and when you press
ENTER, this "OK" button's Click event handler is eventually fired.

I was expecting Button to have a Default property, but can't seem to
find anything like it...

Nov 15 '05 #2
"William Ryan eMVP" <do********@comcast.nospam.net> wrote:
Set the .AcceptButton property of the form to the button that you want to be
the default


Ah, thanks!
Nov 15 '05 #3
Hello, C#!

There is another property of the FORM called CancelButton
which does the same thing, but when you hit ESC
You know, if you click Start->Run and the hit ESC on keyboard,
the dialogbox just disappears...
Buttons also have a property called DialogResult
If you have ever used any DialogBox (and its outcoming result),
like OpenFileDialog or SaveFileDialog...
You can do the same thing...
If you need a piece of code to demo that, please let me know,
I will be more than happy to help you.

You wrote on Thu, 05 Feb 2004 18:12:34 +0000:

CL> Here's an example of what I mean -- press Start -> Run. Notice that
CL> the "OK" button has a dark rectangle around it, and when you press
CL> ENTER, this "OK" button's Click event handler is eventually fired.
With best regards, Nurchi BECHED.
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: AA Arens | last post by:
When I place a record serch utility (vos the button placement wizzrd), I discovered that the Match setting is "Whole Field" by default. How to make "Any Part Of Field" default?
2
by: Paul Brady | last post by:
I have non-computer skilled users entering data into a form. There are certain ranges of values which, if they enter them, make no sense in the application, but I can't test them until they try to...
18
by: Clark Nu | last post by:
It seems that when I define a fuction,I can set a default value to some of the peremeters.When I call the fuction without some of them,the fuction will use the default value automaticlly then...
6
by: Paul Turley | last post by:
Does anyone have some sample script to "press" a button or image button when the user presses the Enter key? I see this behavior on a lot of web pages but I'm not finding any samples. Thx --...
3
by: Jensen bredal | last post by:
Hello, I have an html submit button wich i have converted into a server control(ascx) . I want it serverside click event to be fired on "enter". How can this be achieved? Many thanks in...
2
by: Agnes | last post by:
Once form _Load, i want to set the caplocks on . How can I do that ?? Or I want to set it When the user press "New" button in my program, I want to Caplocks on . Thanks a lot. I try...
15
by: simonoficina | last post by:
Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button object has a property called "default" that can set this button like press "ENTER" key. But in the VB.net I can't find this...
1
by: test | last post by:
Using a DetailsView to update data in SQL 2005, How do I change the default "Update" hyperlink to a more user friendly button? Thanks
10
Shakss2
by: Shakss2 | last post by:
I have a form, where I can activate the search and replace dialogbox when pressing a button. My problem is that the dialogbox opens with the default that it should search for full match only,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.