Keystrokes

John

Junior Contributor
Joined
Feb 3, 2002
Location
The Inner Loop
Set the form's .KeyPreview = True and then use the KeyUp event to check for the key:

Visual Basic:
Private Sub frmCalculator_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
    Select Case e.KeyCode
        Case Keys.NumPad0
            MsgBox "You pressed 0 on the number pad"
    End Select
End Sub
 
Top Bottom