Results 1 to 4 of 4

Thread: Capture Shift+Tab

  1. #1

    Thread Starter
    Member
    Join Date
    May 2003
    Posts
    41

    Question Capture Shift+Tab

    I have multiple text boxes that based on conditions the user is directed to different controls on the form. I need to be able to capture the shift+tab in order to determine which textbox they previously came from. Does anyone have any code or can point me in the right direction to do this?

    Any and all help as always is greatly appreciated.
    Thanks,
    Tomson

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    You need to handle the keydown event. If you need to capture at the form level, set the KeyPreview property to true. This code snippet is in C#, but it shouldn't be to hard to decipher. Let me know if you need translation.

    Code:
    private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) {
        if (e.Shift && e.KeyCode == Keys.Tab) {
            MessageBox.Show("Shift & Tab Pressed!");
        }
    }

  3. #3

    Thread Starter
    Member
    Join Date
    May 2003
    Posts
    41
    Thanks a ton. I will try it. I worked in C++ but it has been many many many years ago. I will let you know if I need any additional help. If not, thanks again.

    Tomson.

  4. #4

    Thread Starter
    Member
    Join Date
    May 2003
    Posts
    41
    Okay, tried it but couldn't get it to work. It acts as if it is only capturing the shift key and not the tab key at the same time.
    Translation would be appreciated.

    Thanks,
    Tomson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width