I have a login form that I made. The user enters a username in textbox1 and then enters a password in textbox2. The user then hits the submit button (button2) and from there it works beautifully. The problem is, I would also like the user to be able to hit the "enter" key after they fill out the password textbox (textbox2) and have it be like they pressed the submit button. When the user hits enter right now, the form hides... I don't know what to do! please help!
use the keypress event
A much easier way (required no code) is to set the Form's http://msdn.microsoft.com/en-us/library/system.windows.forms.form.acceptbutton.aspx to your submit button (If this is a Windows Application)
you put there the submit button's code and when you hit enter the action will be the same like button2.
actualy you have to choice. you type in the user and pass and u click the submit button or just hit the enter key.
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)