azusa1997811
New member
- Joined
- Feb 8, 2014
- Messages
- 1
- Programming Experience
- Beginner
i use keypress to catch keyborad input and after press i use msgbox to direct show ascii
this program i made
Public Class Form1
Private Sub Form_Keypress(ByVal KeyAscii As Integer)
Dim ascii As Integer
Dim Hex, Dec_Hex As String
ascii = KeyAscii
Do Until ascii <= 0
Hex = CStr(ascii Mod 16)
Select Case Hex
Case "10" : Hex = "A"
Case "11" : Hex = "B"
Case "12" : Hex = "C"
Case "13" : Hex = "D"
Case "14" : Hex = "E"
Case "15" : Hex = "F"
End Select
Dec_Hex = Hex & Dec_Hex
ascii = ascii \ 16
Loop
MsgBox("you press : " & Chr(KeyAscii) & vbNewLine & "ASCII is : " & Dec_Hex)
End Sub
end class
----
make in vb6
but the problem is, when i press F1 ~ F12
there no respond , how can i do to let the F1~F12 press can show ascii ?
thanks you , sorry bad english
this program i made
Public Class Form1
Private Sub Form_Keypress(ByVal KeyAscii As Integer)
Dim ascii As Integer
Dim Hex, Dec_Hex As String
ascii = KeyAscii
Do Until ascii <= 0
Hex = CStr(ascii Mod 16)
Select Case Hex
Case "10" : Hex = "A"
Case "11" : Hex = "B"
Case "12" : Hex = "C"
Case "13" : Hex = "D"
Case "14" : Hex = "E"
Case "15" : Hex = "F"
End Select
Dec_Hex = Hex & Dec_Hex
ascii = ascii \ 16
Loop
MsgBox("you press : " & Chr(KeyAscii) & vbNewLine & "ASCII is : " & Dec_Hex)
End Sub
end class
----
make in vb6
but the problem is, when i press F1 ~ F12
there no respond , how can i do to let the F1~F12 press can show ascii ?
thanks you , sorry bad english