473,320 Members | 1,839 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,320 software developers and data experts.

How do I make a Button "active" for the Enter Key?

I'm something of a rookie at .Net. I know I can set TabIndex for
controls in a GroupBox, and tab my way over to a button so it's
"Active" and will be clicked by hitting the Enter key.

But isn't there some way of setting it to the same state? I've built
a very simple login for a tabpage in a tab control, so you enter a
name and password and click the "login" button, which queries a
database to validate you. someone told me it's "correct" programming
to make it so that the user only has to complete his entry of name
and password and then immediately hit Enter and the button should be
in the active state for that without having to do one more tab-over.

I looked in the All Members in the online Help and couldn't see what I
wanted.

Thanks

Nov 20 '05 #1
3 3576
Hi,

Set the forms acceptbutton to the button you want to be clicked when
you press enter.

Ken
--------------------
"felecha" <fe*******@yahoo-dot-com.no-spam.invalid> wrote in message
news:40**********@127.0.0.1...
I'm something of a rookie at .Net. I know I can set TabIndex for
controls in a GroupBox, and tab my way over to a button so it's
"Active" and will be clicked by hitting the Enter key.

But isn't there some way of setting it to the same state? I've built
a very simple login for a tabpage in a tab control, so you enter a
name and password and click the "login" button, which queries a
database to validate you. someone told me it's "correct" programming
to make it so that the user only has to complete his entry of name
and password and then immediately hit Enter and the button should be
in the active state for that without having to do one more tab-over.

I looked in the All Members in the online Help and couldn't see what I
wanted.

Thanks

Nov 20 '05 #2
* fe*******@yahoo-dot-com.no-spam.invalid (felecha) scripsit:
I'm something of a rookie at .Net. I know I can set TabIndex for
controls in a GroupBox, and tab my way over to a button so it's
"Active" and will be clicked by hitting the Enter key.

But isn't there some way of setting it to the same state? I've built
a very simple login for a tabpage in a tab control, so you enter a
name and password and click the "login" button, which queries a
database to validate you. someone told me it's "correct" programming
to make it so that the user only has to complete his entry of name
and password and then immediately hit Enter and the button should be
in the active state for that without having to do one more tab-over.


Assign the button to the form's 'AcceptButton' property.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3
Form.AcceptButton works just great and it was easy to understand how
to use it.

I was looking and looking but if what you're looking for is not there
but somewhere else ...

Thanks to all, this is a big help

F

Nov 20 '05 #4

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

Similar topics

0
by: Philippe Poulard | last post by:
People that have a knowledge of XQuery, XSLT, Ant, JSP/PHP/ASP, Cocoon, XMLBeans, taglibs and many others should recognize any of them in "Active Tags". " Active Tags is a set of specifications...
0
by: Matteo Gelosa | last post by:
I experienced (twice) a problem with db2 for aix 5 64 bits fixpak 9a. Some application was listed with the status "Commit Active" blocking the transaction log a making it full after some time. ...
0
by: Matt | last post by:
When I tried to close VS.NET, it has the following error dialog: "Microsoft Development Environment cannot shut down because a modal dialog is active. Close the active dialog and try again." ...
9
by: Patrick | last post by:
I have an ASP.NET page that searches for someone in the corporate Active Directory. It had been working fine until recently when I changed from Basic Authentication on IIS6 back to Integrated...
0
by: Kevin White | last post by:
I have an app with a notify icon working almost beautifully... The onlyh problem is that the notify icon is "hidden" when "hide inactive icons" is turned on. What does a program need to do to...
2
by: Al | last post by:
May anybody help with the function GetDesktopWindow (imported from the user32.dll)? How to get the active desktop (monitor) window, i.e., a desktop that contains the active window? The active...
0
by: Greg Larsen | last post by:
How add the "Active File" icon (down arrow), and the "Close" icon (X) next on TabPage in the gray space next to the tabs, so when I click on the X the active Tab closes, and and when I click on the...
15
by: pbd22 | last post by:
Hi. I want to create a tab with a little "active tab" arrow below it to tell the user where they are. An example is here: http://personals.yahoo.com/us/search/dashboard Does anybody know of...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.