How can i detect TAB key hit?
thanks:confused:
Printable View
How can i detect TAB key hit?
thanks:confused:
Will this do anything for you?
VB Code:
Option Explicit Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Const VK_TAB = &H9 Private Sub Form_Load() Timer1.Interval = 50 Timer1.Enabled = True End Sub Private Sub Timer1_Timer() If GetAsyncKeyState(VK_TAB) <> 0 Then MsgBox "Tab pressed" End If End Sub
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?
Thanks MarkT, it works for me ! ;)Quote:
Originally posted by MarkT
Will this do anything for you?
VB Code:
Option Explicit Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Const VK_TAB = &H9 Private Sub Form_Load() Timer1.Interval = 50 Timer1.Enabled = True End Sub Private Sub Timer1_Timer() If GetAsyncKeyState(VK_TAB) <> 0 Then MsgBox "Tab pressed" End If End Sub