Hello, I tried using KeyUp, KeyDown, and KeyPressed, but none will catch the key 'Tab' when I pressed the keyboard. Why event I should use to catch the user entered this key? Thanks.
I use the key tab in the axcStringField. The 'Tab' key didn't trigger the KeyDown, KeyUp, or KeyPress. Therefore, i can't compared with vbKeyTab. Other keys like the 'Enter' key will trigger the KeyPress event.
For what reason do you need to capturn the Tab key? [/b][/i][/u][sub]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
Cause I have a program that needs to check the text the user entered while they are inputing the form. Some user will press enter, others may use the tab to move to the next block.
The use the TextBox_Validate event.
If the text fails validation (isn't what you want it to be], then just set the Cancel to True. This will keep the focus on the control. (Assumming that the next control in the Tab order has the CauseValidation property set to True):
Private Sub TextBox1_Validate(Cancel As Boolean)
If TextBox1.Text <> "abc" Then
Cancel = True
Exit Sub
End If
End Sub [/b][/i][/u][sub]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.