하위를 잊어 버렸습니다 ... 이것은 완전히 작동합니다
Public Const VK_NUMLOCK = &H90
Declare Function GetKeyState Lib "user32" Alias "GetKeyState" _
(ByVal ByValnVirtKey As Integer) As Short
Private Sub numlockON()
keybd_event(VK_NUMLOCK, 0, 0, 0) ' Press NUMLOCK key down
keybd_event(VK_NUMLOCK, 0, KEYEVENTF_KEYUP, 0)
End Sub
Private Sub me_keyDown(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.NumLock And Not NLKey Then
If Not GetKeyState(VK_NUMLOCK) Then
e.Handled = True
NumlOn.Start()
Exit Sub
End If
End If
End sub
Private Sub NumlOn_Tick(sender As Object, e As EventArgs) Handles NumlOn.Tick
NLKey = True
If Not GetKeyState(VK_NUMLOCK) Then numlockON()
Application.DoEvents()
NumlOn.Stop()
NLKey = False
End Sub