Click to See Complete Forum and Search --> : Capturing 'F1' Keystroke
Falcondl
Dec 7th, 1999, 02:58 AM
There a way to capture an F1 keystroke? It doesn't have an ascii code...
Ghost
Dec 7th, 1999, 03:08 AM
You have to use either KeyUp or KeyDown. And check for KeyCode = vbKeyF1
rreese
Dec 7th, 1999, 03:09 AM
It doesn't have a "keypress" ascii value but it does have a "keycode" that can be captured in the "KeyDown" event(say of a test box). The keycode is 112 for F1 but you'll find more in the MSDN under "Keycode constants"
Charlezz
Dec 7th, 1999, 03:13 AM
Ok, to find any keycode goto your form_keydown event and type in Debug.Print KeyCode. This will type a number in the visual basic "Imediate Box". That number is the number of the key typed. Now just type in a statement like: If keycode = 112 then msgbox "You pressed F1". The keycode for F1 is 112.
Falcondl
Dec 7th, 1999, 03:45 AM
thanks. =))
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.