|
-
Apr 15th, 2003, 09:18 AM
#1
Thread Starter
Lively Member
Keypress event [Resolved]
I want to use the keypress event on a form so that when the user presses the right or left arrow my cmdNext and cmdPrevious buttons will execute accordingly. If I use the form's keypress event it won't work cause the focus goes into the various textboxes or buttons on the form. How do I do it?
Last edited by Jimmy80; Apr 15th, 2003 at 09:44 AM.
-
Apr 15th, 2003, 09:22 AM
#2
If you set the Form's KeyPreview property to true, the form receives the key events before the controls do.
I think you need to use the KeyDown event though, because the keypress event cannot trap the arrow keys.
-
Apr 15th, 2003, 09:43 AM
#3
Thread Starter
Lively Member
Thanks Frans, it worked as you said, with the keydown event.
-
Jun 19th, 2003, 10:58 PM
#4
Lively Member
Exit Sub in TextBox
How can you tell if the person is typing in a textbox? B/c if they are I dont want the Keypress todo anything, i want to let them continue to type. Understand what I'm asking? 
-
Jun 20th, 2003, 07:21 AM
#5
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
|