Using Keypress Visual Basic

This is how to using keypress event in Visual Basic VB.NET. For Example below is code that handle “ENTER” keyboard with keyboard code “13“. Replace action with you want to do.

If you want to change the “ENTER” event, replace “13” with others ASCII keyboard code.

If e.KeyChar = Convert.ToChar(13) Then
'Your Action Here...
End If
Catch ex As Exception
End Try

Leave a Reply

Your email address will not be published. Required fields are marked *