You need to set KeyPreview to true when loading the form, it should work then
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load Me.KeyPreview = True End Sub Private Sub Form1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles Me.KeyPress MsgBox(e.KeyChar) End Sub
Balibrera
source share