How to trap TAB key in a single line text box

I want to trap TAB key in a text box so that i can send focus to the next tab in a tab control. Can anyone help me out. (I dont want to use leave event, also keypress and keydown events donot trap tab key).

Thnx,
Vikas

Comments

  • Events cascade from the top down. Meaning from parent to child to inner child to inner inner child...

    You won't see the tab key in the event for the textbox.keypress because the form sees it first and doesn't pass it on.

    Catch the Form's keypress and handle it there. Of course, you will need to check who the active control is make sure its only the control you want to handle.

    -ray

    : I want to trap TAB key in a text box so that i can send focus to the next tab in a tab control. Can anyone help me out. (I dont want to use leave event, also keypress and keydown events donot trap tab key).
    :
    : Thnx,
    : Vikas
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion