Results 1 to 2 of 2

Thread: Each Key on Keyboard has 3 ascii Codes!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Location
    Petach-Tekvia
    Posts
    25

    Post

    You all know that each key, how can I see
    all the ascii codes for, say the key: "q" ??
    (I want to press 'q' and get the 3 ascii codes in a message box)
    Must be a way right?

    Mansour.
    [email protected]

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Try something like this. Set Form's KeyPreview property to True and then use this code:

    Code:
    Private Sub Form_KeyPress(KeyAscii As Integer)
        MsgBox "You pressed: " & Chr(KeyAscii) & vbCrLf & " ASCII Code: " & KeyAscii
    End Sub
    
    Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
        MsgBox "You pressed: " & Chr(KeyCode) & vbCrLf & " ASCII Code: " & KeyCode
    End Sub
    ------------------

    Serge

    Senior Programmer Analyst
    [email protected]
    [email protected]
    ICQ#: 51055819

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width