|
-
Dec 31st, 2002, 06:49 AM
#1
Thread Starter
Lively Member
Using Shortcut Key to set focus?
I was wondering if there was a way for this to work...
My app currently has focus on "Text1".
When the "Enter" key is pressed on the keyboard,I would like for my app to set focus to "Text2".
I put info into text1 and would rather hit enter to move to the next textbox than deal with the mouse(save alot of tme)
Is this easy to do?
Thanks Ahead of time.
-
Dec 31st, 2002, 07:03 AM
#2
-= B u g S l a y e r =-
simulate a tab key
VB Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{tab}"
KeyAscii = 0
End If
End Sub
-
Dec 31st, 2002, 07:04 AM
#3
-= B u g S l a y e r =-
KeyAscii = 0
is to prevent the annoying beep
-
Dec 31st, 2002, 07:49 AM
#4
Let me in ..
Originally posted by peet
KeyAscii = 0
is to prevent the annoying beep
I'd say also include on error resume next and on error goto 0 in it.
Sendkeys is friggin weird.
-
Dec 31st, 2002, 08:00 AM
#5
-= B u g S l a y e r =-
yes, you are probably right... I never used this code much.
He can also set focus to the text2 instead of using the sendkeys...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|