Syntax for TabControl

Hi. I am working with a TabControl that has three tabs.  I need the syntax to determiine what tab page the user is on.   Here are the names of the controls that I'm using:

tabWebBook - name of the tab control
tabPageWebSites - name of tab page 1
tabPageCreditCards - name of tab page 2
tabPageSettings - name of tab page 3

I am working on a Case statement and need the correct syntax for the following:
select case tabWebBook.tabPageWebSites
                  ' do something
           case tabWebBook.tabPageCreditCards
                   ' do something
           case tabWebBook.tabPageSettings
                   ' do something
end select

Who is Participating?
Shane32EEConnect With a Mentor Commented:
When using the If statement, it would look like this:

If tabWebBook.SelectedTab Is tabPageWebSites Then
 ' do something
ElseIf tabWebBook.SelectedTab Is tabPageCreditCards Then
 ' do something
ElseIf tabWebBook.SelectedTab Is tabPageSettings Then
 ' do something
End If

The Select Case statement does not support the Is comparison.  But you can use the SelectedIndex property like this:

Select Case tabWebBook.SelectedIndex
  Case 0 'first tab (tabPageWebSites)
    'do something
  Case 1 'second tab (tabPageCreditCards)
    'do something
  Case 2 'third tab (tabPageSettings)
    'do something else
End Select
Agent909Author Commented:
I tested it, and it works great!  Thank you.
All Courses

From novice to tech pro — start learning today.