i am looking for the ASCII numbers for:
DELETE (the button)
Up arrow
Down arrow
Left arrow
Right arrow
ASCII numbers as in 13 = ENTER, etc...
Printable View
i am looking for the ASCII numbers for:
DELETE (the button)
Up arrow
Down arrow
Left arrow
Right arrow
ASCII numbers as in 13 = ENTER, etc...
How about using the built in vb constants, eg :
private Sub Form_Load()
Debug.print "Delete = " & vbKeyDelete
Debug.print "Up = " & vbKeyUp
Debug.print "Down = " & vbKeyDown
Debug.print "Left = " & vbKeyLeft
Debug.print "Right = " & vbKeyRight
Debug.print "Enter = " & vbKeyReturn
End Sub
That should produce :
Delete = 46
Up = 38
Down = 40
Left = 37
Right = 39
Enter = 13
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
The easiest way to find any key code is to insert the following line into a form and run the program.
private Sub Form_KeyDown(KeyCode as Integer, Shift as Integer)
Debug.print "Down " & chr(KeyCode) & " Number = " & KeyCode
End Sub
Puch keys to your hearts content
Richard
What are you planning to do with arrow keys? These may work on a form which has no command buttons. Since these are used to move through the various controls on the form. The Form_KeyPreview may allow you to trap all keys except these arrow keys. You are better off using a form without any command buttons, use stylish 3DPanels instead.
Another option for you might be as follows.
Use number keys on the NumPad with the NumLock ON.