Click here to Skip to main content
16,015,393 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
hi how can i put tab function to the button in vb.net
i will explain the details
i want the tab control go to the LOGIN button after entering user name and password


help me please
Posted
Comments
Sergey Alexandrovich Kryukov 17-Nov-11 1:46am    
What is "tab control"? Tag your UI library: WPF, Forms, ASP.NET, what?
--SA

SET THE TAB INDEX ----- FOR USERNAME TEXTBOX TAB INDEX 0
FOR PASSWORD TEXTBOX TAB INDEX 1
FOR LOGIN BUTTON TAB INDEX 2
 
Share this answer
 
Comments
afsal.mp 17-Nov-11 1:39am    
thanks
afsal.mp 17-Nov-11 2:01am    
it is not working. for each action i forced to press tab key or mouse. i need to use enter button for that. i want to use enter button after entering user name. and so on
Each form has properties such as AcceptButton, CancelButton and HelpButton. If you declare your login button to be the AcceptButton, then the user can just press the Enter/Return key to press the button.

Hope this helps
 
Share this answer
 
Comments
afsal.mp 17-Nov-11 2:01am    
for each action i forced to press tab key or mouse. i need to use enter button for that. i want to use enter button after entering user name. and so on
Wayne Gaylard 17-Nov-11 2:08am    
That is not standard behaviour and will confuse your users. You should stick to Windows standard implementations so that users can easily use your application. The standard behaviour for this is when they have entered the username they press tab to take them to the password box, when they have entered their password they press enter to continue.
VB
If e.KeyCode = Keys.Enter Then
            Me.PWDTXTBOXNAME.Select()
        End If


WRITE THE ABOVE CODE KEY_DOWN EVENT OF TEXTBOX OF USER.....SAME WAY IN THE KEY_DOWN EVENT OF TEXTBOX OF PASSWORD WRITE THIS CODE

VB
If e.KeyCode = Keys.Enter Then
            Me.BUTTONNAME.Select()
        End If
 
Share this answer
 
v2
Comments
NikulDarji 17-Nov-11 2:30am    
Hey I am giving the solution but as Wayne suggest this is not standard behavior........:)
afsal.mp 17-Nov-11 3:07am    
standard behavior?
afsal.mp 17-Nov-11 3:06am    
where is the key down event.. i am a beginer to asp
NikulDarji 17-Nov-11 3:27am    
Follow this link it shows how to add key_down event.....
http://www.homeandlearn.co.uk/net/nets10p3.html

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900