I trying to develop a program using vb .net that could check or uncheck a check box when the caps lock key is pressed. I used the below code to do the same, but its not working.
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.CapsLock) Then
checkbutton_caps.Checked = True
End If
So what's wrong with the above code?