Public Declare Function GetKeyState Lib "User32" Alias "getKeyState" (Byval Nvirtkey As INTEGER) AS INTEGER
Private sub button1_click (byvale as system.object, byval e as system.eventargs) Handles Button1.click
The status of the keyboard Caps Lock button is & H14, the INSERT key value is & H2D, which is most convenient to use Keys.Insert.
IF getKeyState (& H2D) THEN
Messagebox.show ("Light")
Else
Messagebox.show ("Light Oil")
END IF
'Change # h91 is the state of the Scroll Lock button,
'Change to & H90 is the state of Num Lock.
End Sub