G
Guest
Hi all
I'm trying to get a message box to appear when a user presses a certain key when in a certain control. I start by assigning some code to the KeyDown event for that control.
Problem is, I don't know how to test for a particular key being pressed (in this case F1). This should be simple, but the Help files don't appear to cover it.
Please tell me what the code to test what key is being pressed is. Is it:
If (vbKeyF1 = True) Then
If (vbKeyF1 > 0) Then
or something else?
Whatever I've tried so far, the event (and therefore the code) is triggered when any key is pressed, rather than only if the F1 key is pressed.
Please help me out!
Thanks
David
I'm trying to get a message box to appear when a user presses a certain key when in a certain control. I start by assigning some code to the KeyDown event for that control.
Problem is, I don't know how to test for a particular key being pressed (in this case F1). This should be simple, but the Help files don't appear to cover it.
Please tell me what the code to test what key is being pressed is. Is it:
If (vbKeyF1 = True) Then
If (vbKeyF1 > 0) Then
or something else?
Whatever I've tried so far, the event (and therefore the code) is triggered when any key is pressed, rather than only if the F1 key is pressed.
Please help me out!
Thanks
David