Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can i turn the cursor from one textbox to another
Message
From
14/08/2001 11:35:58
 
 
To
14/08/2001 09:42:43
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00543473
Message ID:
00543557
Views:
22
This message has been marked as the solution to the initial question of the thread.
>Hi! I am new to visual basic and i am working on a case study but my knowledge is too little about this application. My question is, how can i transfer the cursor from the first textbox onto the second textbox by pressing the "Enter" key?

Normally, the Enter key is used to activate a command button marked as the default for a form. A good example is an about form with an OK button. The TAB is what most Windows apps use to navigate through the controls on a form. But, if you really want to implement this behavior, you can put some code on the KeyPress or KeyUp/KeyDown events of the textbox like so:
Private Sub txtControl_KeyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then SendKeys "{TAB}"
End Sub
Keep in mind that you may get unwanted results if later you want to have a command button to act as the default.
HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform