Tab key trapping in VB.Net 2005

  • Thread starter Thread starter Aaron Smith
  • Start date Start date
A

Aaron Smith

How do you trap the tab key in a textbox? I have tried all the key
events, and none of them seem to work right with the tab key. It seems
when you press the tab key in one textbox, the keyup event of the next
textbox in in the tab order gets the tab keyup event. I need to know
when the tab key is pressed in the current text box, not the next one...
 
Aaron said:
How do you trap the tab key in a textbox? I have tried all the key
events, and none of them seem to work right with the tab key. It seems
when you press the tab key in one textbox, the keyup event of the next
textbox in in the tab order gets the tab keyup event. I need to know
when the tab key is pressed in the current text box, not the next one...

Override the ProcessCmdKey function. that will give you access to the
Tab and other keys not in the keypress event.

Chris
 
Back
Top