Results 1 to 2 of 2

Thread: keydown type thing.

  1. #1
    TaylorGordon
    Guest

    keydown type thing.

    How would you make a private sub form_keydown, without having to have the form in focus?

    What i want is for if you have my program open, but are currently focused on program, and hit "enter" then lblmessage = "yo" lets say.

  2. #2
    Matthew Gates
    Guest
    Use the GetAsyncKeyState API function.


    VB Code:
    1. Private Declare Function GetAsyncKeyState Lib "user32" _
    2. (ByVal vKey As Long) As Integer
    3.  
    4. Private Sub Timer1_Timer()    
    5. If GetAsyncKeyState(iKey) Then lblmessage.Caption = "yo"
    6. End Sub

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