Tab Control - which tab?

  • Thread starter Thread starter Martin Dashper
  • Start date Start date
M

Martin Dashper

I have a form containing a 3-tab tab control. Which event can I employ
to note the ocurrence of a change of tab, and how can I then determine
which tab has been selected?

Martin Dashper
 
I have a form containing a 3-tab tab control. Which event can I employ
to note the ocurrence of a change of tab, and how can I then determine
which tab has been selected?

You can use the tabcontrol's OnChange event.

To get the index value of the selected tab use: me.tabname =
and perform actions according to what tab you're on.

example:
Select Case Me.Tabname
Case 0
msgbox "You're on the first tab"
Case 1
msgbox "You're on the second tab"
Case 2
msgbox "You're on the third tab"
Case else
msgbox "Something went wrong."
End Select


Good luck.

Jesper Fjolner
 
Back
Top