Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tab key does not trigger KeyPress??
Message
 
To
03/10/2003 11:10:59
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00834823
Message ID:
00834960
Views:
15
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform