Results 1 to 2 of 2

Thread: Find out if a user tabbed out of control (Resolved)

  1. #1

    Thread Starter
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464

    Find out if a user tabbed out of control (Resolved)

    I am implemeting a win form with a tab control on it. I need to set it up to where when the last control of the current tab is tabbed out of with the Tab button on the keyboard that the next tab in the tab control is navigated to and the focus is given to the first control on that tab. Anyone know how to do this?

    I just need it for when the user hits the Tab button, not when they click with the mouse to another control.
    Last edited by hellswraith; Oct 3rd, 2003 at 01:16 PM.

  2. #2

    Thread Starter
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Never mind, figured it out:

    Since I have a btn below the tab control, when that gets focus I look at what tab is currently selected, if it is not the end one, move to the next tab, if it is the last tab, continue with the focus on the button.

    Code:
             If e.KeyCode = System.Windows.Forms.Keys.Tab Then
                If tabControl.SelectedTab Is tabControl.TabPages(0) Then
                    'Change the selected Tab to 1
                    tabSemap.SelectedTab = tabControl.TabPages(1)
                Else
                    If tabControl.SelectedTab Is tabControl.TabPages(1) Then
                        'Change the selected Tab to 2
                        tabControl.SelectedTab = tabControl.TabPages(2)
                    End If
                End If
            End If

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