473,698 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3595
Hi,

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

Ken
--------------------
"felecha" <fe*******@yaho o-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.AcceptButt on 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
1187
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 that allow to use XML tags as actions to perform. Active Tags specifies a framework for XML Native Programming where usual procedure-oriented sentences can be mixed with declarative sentences. Active Tags tightly integrates XML technologies in an...
0
1808
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. The application was killed/forced, but nothing happened. The application didn't lock anything. One application was the asncap replication component, while others were user applications. I got backup to fixpak 7a and the problem disappeared...
0
1618
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." But I couldn't see any modal dialog, and eventually I kill the process to close VS.NET any ideas??
9
3172
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 Windows authentication. The error occurs on the FindAll method. The exceptions are as follows. anyway of getting the code working with Integrated Windows authentication (too annoying for user to enter user-name/password). Note I do need to use...
0
853
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 keep a notify icon "active" so it doesn't get hidden? The nature of this program is such that the user needs easy access to the icon and it should not be hidden. Thanks, Kevin
2
6690
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 window handler may be acieved by GetActiveWindow() (imported from user32.dll), but I cannot realize how to "connect" GetActiveWindow to GetDesktopWindow
0
1433
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 down arrow the All active tabs are displayed.
15
8941
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 any examples out there on how to do this? Thanks!
0
8683
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9031
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.