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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.