Tab Control - which tab?

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
 
J

Jesper F

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top