Select tab from code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to be able to change the current tab in a tabstrip control from code,
preferably using the caption, but am struggling with the correct syntax.

Can anyone help?

Thanks in advance.


swas
 
Look in VBA help under PageIndex. You probably want the Pages property.
 
RG,

Yes I had looked at the pageindex property, but wasn't sure how to use it to
actually change the current viewed tab.

Setting the tabstrip default property changes the tab, ie:

tabTabStrip = intIndex

and I can loop through all pages first to find the match for my caption
search.

Thanks


swas
 
I don't know if this is what you are looking for but you can refer to a tab
just using it's name.

For instance, I have a tab control with a tab named "tabCalendar" with a
caption of "Calendar" that is hidden until a date control is clicked on and
the calendar on the tab is needed.

To make the tab visible I just need to put into code

tabCalendar.Visible = True
tabCalendar.SetFocus

Essentially you treat it as if it is any other control on the form.

jason
 
Jason,

I'm trying to select a page within the tab - from what I can see of your
note you are referring to the tab control itself.

As per my previous post, I managed to work it out though.

Thanks for the note.


swas
 
Back
Top