Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validation VB 5.0
Message
 
To
20/06/2001 18:30:27
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00521712
Message ID:
00521722
Views:
20
>Hello Guys
>In the Keypressed event of he form (with KeyPreview = True), I check to see if the return key has been pressed then do a Sendkey {TAB} so that when the user presses the enter key on the textbox, focus will be set to the next textbox.
>
>I tried doing the validation in the Keypressed event of the TextBox
>and that seems to work just fine, but I cannot trap for when the user presses
>the Tab key to move to the next textbox.
>
>Is there some way that I can trap for the TAB key being pressed within the form
>or can anyone out there suggest a different approach???

I don't understand that part.

Here is the code to simulate the Tab when the user press Enter:
Private Sub Form_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        KeyAscii = 0
        SendKeys "{TAB}"
    End If
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform