Click to See Complete Forum and Search --> : Help with sstab


Trond Sørensen
January 18th, 2000, 03:59 AM
I have some problems with the sstab control in vb6.
I have a sstab with three tabs on it and a label wich I want to change caption after wich tab I press on
the sstab. How do I do that?

JimmyT
January 20th, 2000, 08:31 AM
This is a simple solution, please feel free to experiment with other options.

1) Create a new Standard EXE project
2) Add an SSTab to Form1 (don't modify it at all)
3) Paste the following into the code window for Form1:


option Explicit

private Sub SSTab1_Click(PreviousTab as Integer)
Dim myIndex as Integer
myIndex = SSTab1.Tab
SSTab1.TabCaption(myIndex) = "new Caption"
End Sub





Run the project.

As you click on a new tab, the tab caption is changed to "New Caption"

Good Luck...

netSurfer
January 20th, 2000, 09:58 AM
and if you want to change the caption on the label:

Where JimmyT put:

myIndex = SSTab1.Tab
SSTab1.TabCaption(myIndex) = "new Caption"

replace the SSTab1... with:

label1.caption = SSTab1.TabCaption(myIndex)