Quote:
>Hi all,
>Does anyone know of a way to trap the Tab key from a text box (or any other
>control for that matter). Microsoft seem to have stripped it out of the
>KeyDown and KeyUp events for reasons best known to themselves. Basically I
>need to know when the user has tabbed between two specific text boxes.
If EVERY control on your form has TabStop=False, then you can trap the Tab
key in the KeyPress event ONLY. It still is not available in KeyDown or
KeyUp(!) This behavior bugs the hell out of me, but what can you do?
I take it from your post that you specifically want to know when the user
presses the Tab key to go from Text1 to Text2 as opposed to clicking on
Text2, right? If all you wanted to know was when the text box got the focus,
you could use the GotFocus event. Sorry if that's "Well, DUH!" material to
you.