VB NET Using Key Code
In This VB.Net Tutorial We Will See How To Use KeyCode On KeyDown To Check Which Key Is Pressed Like ENTER or SPACE In Visual Basic.Net Programming Language And Visual Studio Editor.
Project Source Code:
Public Class Form_Key_Code
Private Sub Form_Key_Code_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
Dim code As String
code = e.KeyCode
Select Case code
Case 32
Label1.Text = "Spacebar"
Case 13
Label1.Text = "Enter"
End Select
End Sub
End Class
///////////////OUTPUT: