Home All Groups Group Topic Archive Search About

Tab key trapping in VB.Net 2005

Author
17 Feb 2006 6:30 PM
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 Smith
Remove -1- to E-Mail me. Spam Sucks.

Author
17 Feb 2006 6:41 PM
jvb
Try setting the acceptstab property..
Author
17 Feb 2006 7:45 PM
Aaron Smith
This works perfectly. Thanks!

jvb wrote:
Show quoteHide quote
> Try setting the acceptstab property..
>


--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.
Author
17 Feb 2006 8:23 PM
jvb
Your welcome...
Author
17 Feb 2006 7:11 PM
Chris
Aaron Smith wrote:
> 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