Results 1 to 2 of 2

Thread: VBKey

  1. #1

    Thread Starter
    Hyperactive Member MikeBAM's Avatar
    Join Date
    Sep 2000
    Location
    Metro Detroit
    Posts
    284
    Code:
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    
    
    Private Sub Timer1_Timer()
    Dim iKey As Integer
    For iKey = 3 To 255
    If GetAsyncKeyState(iKey) Then Text1 = Text1 & iKey
    Next
    End Sub
    My question: instead of putting numbers in the text box like that does, how can u make it the key that hit pressed?
    like 'a' is 65. instad of showning 65 it shows 'a'??
    Please help.
    ~* )v( ! /< E *~

  2. #2
    Guest
    You can use the Chr function, it translates ASCII codes to keynames.

    Code:
    MsgBox Chr(65)
    will give a

    Sunny

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