Pages

Wednesday 22 January 2014

Check Capslock is on or off

Private Sub Text_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Textbox1.KeyDown
        If e.KeyCode = Keys.CapsLock Then
            If My.Computer.Keyboard.CapsLock Then
                MsgBox("CAPS LOCK is on")
            Else
                MsgBox("CAPS LOCK is off")
            End If
        End If
    End Sub

No comments:

Post a Comment