Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 8 Then
KeyCode = 0
End If
End Sub
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
the keydown event you suggested only works when there is no other textbox (or other control that can get the focus) on the form.
when you draw a form with 2 textboxes and you press the tab-button on the first textbox,his keydown event will not be fired, instead the focus will be given at the second textbox.
I need to be able to catch the tab-button pressed on the first text-box.
I'm not sure what you want to do with the Tab key.
If you don't want to Tab from control to control, set the TabStop property to False for any property you don't want to Tab to.
If something else, please clarify
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
if the enter-button or the tab-button is pressed on a textbox, i want to do some checks about the data that was inputted in the textbox.
if the data is correct, i want to give the focus to one control,if the data isn't correct another control gets the focus.
That is briefly what i want to do.
The lostfocus event is not an option because when i click any other control on my form (for example a dropdownlist) the lostfocus event got fired and my tests would give the focus to another object than the one clicked.
i hope this makes my situation a little more understandable.
Look at the Validate event - it's designed for this situation
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
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.