Assigning arrow keys as hot keys 
Author Message
 Assigning arrow keys as hot keys

How can I assign the keyboard arrow keys as hot keys (ALT - key) to a
command button?
I happen to be using a built in bitmap rather than text for the cmd button.

I can put &<key> in the caption and it works, but how I use the arrow keys?
Thank,



Sat, 22 May 2004 12:34:17 GMT  
 Assigning arrow keys as hot keys

I suppose you could use the KeyDown event to trap the arrow keys, then
include or call the code used by the button click. Remember to set the
KeyPreview property of the form to true else this will not work.

*** Not tested ***

Private Sub Form_KeyDown(pintKeyCode As Integer, pintShift As Integer)
    Select Case pintKeyCode
        Case  vbKeyUp
            'Insert Key up code
        Case vbKeyDown
            'Insert Key down code
        Case Else
    End Select
End Sub

--

Sandra Daigle, Microsoft Access MVP


Quote:
> How can I assign the keyboard arrow keys as hot keys (ALT - key) to
a
> command button?
> I happen to be using a built in bitmap rather than text for the cmd
button.

> I can put &<key> in the caption and it works, but how I use the
arrow keys?
> Thank,



Sat, 22 May 2004 22:49:37 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need help in assigning Multiple Hot Keys : )

2. Need help in assigning Hot Key....please

3. Sending key command to a global hot key

4. Arrow Keys act Like Tab key

5. Enter Key and arrow keys Tab viia KEYDOWN

6. Standard for function-keys and hot-keys?

7. unable to trap arrow key with key down event

8. ARROW KEYS AND TAB KEY AFTER DEBUGGING AN OCX

9. Form Navigation with Arrow keys

10. detecting arrow keys

11. Listview and Arrow Keys

12. Trap cursor/arrow key presses

 

 
Powered by phpBB® Forum Software