Community discussion forum

Trapping Tab Key

  • 4 years ago

    Why can't I trap the Tab key using keycode 9 in a Text Box

  • 4 years ago

    i think the problem is that you have other controls on your form and VB switches to the next control before it recognizes the keydown event. u might want to try the validate event, but that'll also happen if someone clicks on a different control, so it depends on what exactly u want to do, but i guess if u have to have it only by key pressing, then you can keep track of all the controls' keydown events to see if they're being clicked on , or tabbed to(though i didnt really think that through completely )



    Shmosel

  • 4 years ago

    I posted a link to a resource in this forum thread:  http://www.developerfusion.com/forums/topic-25130.

  • 4 years ago
    Thanks People! I also found out you can use keycode 9 on the keydown event of a RichTextBox
    will trap it!!
  • 2 years ago

    The KeyUp event will trap the tab key in a textbox.

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback