Link to home
Start Free TrialLog in
Avatar of hutchison
hutchison

asked on

Capturing F Keys

How do i capture an F Key? I want to be able to run a function on the keypress of a key say F4.
Avatar of Vbmaster
Vbmaster

One solution would be to set the KeyPreview property of the form to True, then you can intercept any key in the KeyDown/KeyUp event. The F keys are defined as constants (vbKeyF1 -> vbKeyF12).
One solution would be to set the KeyPreview property of the form to True, then you can intercept any key in the KeyDown/KeyUp event. The F keys are defined as constants (vbKeyF1 -> vbKeyF12).
Sorry for the double post, both my personailities want to contribute.
ASKER CERTIFIED SOLUTION
Avatar of Juilette
Juilette

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hutchison

ASKER

vbMaster yours was exactly the same as well when i hit accept answer i didn't see who was the accepted answer. Both work the same.