Can anyone please tell me if it is possible to tell whether or not CAPS/NUM/SCROLL locks are on/off thru VB code, if so, can you point me in the general direction.
Set the form's KeyPreview property to True (the form will respond to keyboard events before a given control does). In the form KeyPress event, try something like:
Select Case KeyAscii
Case vbKeyCapital
'Caps lock code
Case vbKeyNumlock
'NumLock code
Case Else
End Select
Don't know that I've ever seen a constant/hex value for the ScrLock key- that's a new one on me. You can find more about key constants & related topics in the VB help.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.