Private Sub Form_Load()
If CapsLock() = 1 Then Label1 = "On" Else _
Label1 = "Off"
End Sub
Private Sub cmdToggle_Click()
GetKeyboardState kbArray
kbArray.kbByte(VK_CAPITAL) = _
IIf(kbArray.kbByte(VK_CAPITAL) = 1, 0, 1)
SetKeyboardState kbArray
Label1 = IIf(CapsLock() = 1, "On", "Off")
End Sub
Private Sub cmdTurnOn_Click()
GetKeyboardState kbArray
kbArray.kbByte(VK_CAPITAL) = 1
SetKeyboardState kbArray
Label1 = IIf(CapsLock() = 1, "On", "Off")
End Sub
Private Sub cmdTurnOff_Click()
GetKeyboardState kbArray
kbArray.kbByte(VK_CAPITAL) = 0
SetKeyboardState kbArray
Label1 = IIf(CapsLock() = 1, "On", "Off")
End Sub