Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tab key does not trigger KeyPress??
Message
 
À
03/10/2003 11:10:59
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00834823
Message ID:
00834960
Vues:
16
>The Tab key does not trigger the KeyPress event. Is there a simple way of of finding out when the user presses the Tab (or Shift Tab) key, and send it to the KeyPress event of a text or combo box?

I don't know of a simple way to find out if a user pressed the Tab key (it's strange that key press event doesn't catch this in VB6), but you could check for a condition in the lost focus event and keep the focus on the control in question if that's what you want to do.
Private Sub txtImportFile_LostFocus()

If Me.txtImportFile.Text <> "test" Then
    Me.txtImportFile.SetFocus
End If

End Sub
Al Williams

Anola MB, CANADA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform