|
-
Mar 23rd, 2007, 02:22 PM
#1
Thread Starter
Lively Member
simple keypress question?
How can i make the arrow keys "click" a command button? example, left arrow key is next, right arrow key is back?
-
Mar 23rd, 2007, 02:42 PM
#2
PowerPoster
Re: simple keypress question?
on the keypress use somethinglike this
cmdNext_click
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Mar 23rd, 2007, 02:43 PM
#3
Re: simple keypress question?
You'll have to research to get the exact syntax, but
In the KeyDown event of the Form, you'll get a KeyCode passed to you. You can then test something like this:
vb Code:
Select Case KeyCode
Case vbKeyLeft
Call cmdBack_Click
Case vbKeyRight
Call cmdNext_Click
' etc.
End Select
"It's cold gin time again ..."
Check out my website here.
-
Mar 23rd, 2007, 02:46 PM
#4
Member
Re: simple keypress question?
Call cmdNext_click
Edit:The above response is much better, use that one.
-
Mar 23rd, 2007, 09:34 PM
#5
Re: simple keypress question?
Just be sure that there's no text box or any other object stealing the focus. Bear in mind, a command button CAN be selected without being clicked, so if CmdBack has focus, a test in Form_KeyPress won't trigger anything.
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
|