Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can i turn the cursor from one textbox to another
Message
De
14/08/2001 11:35:58
 
 
À
14/08/2001 09:42:43
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00543473
Message ID:
00543557
Vues:
14
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform