Results 1 to 4 of 4

Thread: Tab key press

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    120

    Tab key press

    How can i detect TAB key hit?

    thanks

  2. #2
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141
    Will this do anything for you?
    VB Code:
    1. Option Explicit
    2. Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    3. Const VK_TAB = &H9
    4.  
    5. Private Sub Form_Load()
    6.     Timer1.Interval = 50
    7.     Timer1.Enabled = True
    8. End Sub
    9.  
    10. Private Sub Timer1_Timer()
    11.     If GetAsyncKeyState(VK_TAB) <> 0 Then
    12.         MsgBox "Tab pressed"
    13.     End If
    14. End Sub

  3. #3
    DaoK
    Guest
    Do you want to make something with a textbox ? Like when you press Tab it do not switch to an other control but just make space in the textbox?

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    120
    Originally posted by MarkT
    Will this do anything for you?
    VB Code:
    1. Option Explicit
    2. Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    3. Const VK_TAB = &H9
    4.  
    5. Private Sub Form_Load()
    6.     Timer1.Interval = 50
    7.     Timer1.Enabled = True
    8. End Sub
    9.  
    10. Private Sub Timer1_Timer()
    11.     If GetAsyncKeyState(VK_TAB) <> 0 Then
    12.         MsgBox "Tab pressed"
    13.     End If
    14. End Sub
    Thanks MarkT, it works for me !

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