Why does num lock goes off automatically when the program run.
How do you turn in on in vb.
Thanks
Printable View
Why does num lock goes off automatically when the program run.
How do you turn in on in vb.
Thanks
Put all this in the declaration section
Put this in the form_loadCode:Private Declare Function GetKeyboardState Lib "user32" (pbKeyState As Byte) As Long
Private Declare Function SetKeyboardState Lib "user32" (lppbKeyState As Byte) As Long
Const VK_NUMLOCK = &H90
Code:Dim cls As Boolean
Dim keys(0 To 255) As Byte
GetKeyboardState keys(0)
cls = keys(VK_NUMLOCK)
If cls <> True Then
keys(VK_CAPITAL) = 1
SetKeyboardState keys(0)
End If