Add a label to a form and drop in the code below, this works fine.
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
getKeyStates()
End Sub
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.CapsLock Or e.KeyCode = Keys.NumLock Then
getKeyStates()
End If
End Sub
Private Sub getKeyStates()
Dim outString As String = String.Empty
If My.Computer.Keyboard.CapsLock Then
outString = "CAPS"
End If
If My.Computer.Keyboard.NumLock Then
If outString.Length > 0 Then
outString = outString + " | "
End If
outString = outString + "NUM"
End If
Label1.Text = outString
End Sub