Formunuza 2 adet label ve 2 adet textbox ekleyiniz. txtKey name'li textbox'ın başına Karakter caption'lı labeli koyunuz. txtAscii name'li textbox'ın başına ise Ascii Kodu caption'lı labeli koyunuz.
Kod:
Dim strKey As String
Dim strAscii As String
Private Sub txtKey_KeyPress(KeyAscii As Integer)
If txtKey.Text <> "" And txtAscii.Text <> "" Then
txtKey = "": txtAscii = ""
End If
strAscii = KeyAscii
txtAscii.Text = strAscii
Select Case strAscii
Case 13
' eğer enter ise
txtKey.Text = "Enter"
Case 8
' backspace ise
txtKey.Text = "BackSpace"
Case 27
' Esc ise
txtKey.Text = "Esc"
Case 32
' space ise
txtKey.Text = "SpaceBar"
End Select
End Sub
