Solved

Add tabs to sstab control at runtime

Posted on 2003-11-08
3
535 Views
Last Modified: 2013-12-26
How do I add tabs to an SStab control in VB6 at runtime? I have the SStab control added to my form, named SSTab1, which has 3 tabs and I'd like to add a fourth.

I tried this to no avail:

Load SSTab1.Tabs(4)



Also, how do I determine the total number of current tabs at runtime? I would expect something like this, but haven't been able to find anything that works:

intNumofTabs = SSTab1.Tabs.Count


0
Comment
Question by:josephfluckiger
3 Comments
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 30 total points
ID: 9708794
Private Sub Command1_Click()

' get # of tabs
MsgBox SSTab1.Tabs

' change TabsPerRow and Tabs property
SSTab1.TabsPerRow = 5
SSTab1.Tabs = 4

End Sub
0
 
LVL 5

Assisted Solution

by:jayeshshah
jayeshshah earned 20 total points
ID: 9709232
Private Sub Command1_Click()
    SSTab1.Tabs = SSTab1.Tabs + 1
    SSTab1.Tab = SSTab1.Tabs - 1
End Sub


K'Regards

Jayesh
0
 
LVL 1

Author Comment

by:josephfluckiger
ID: 9709652
Beauty. Thanks both. The first answer by vinnyd79 shows how to create a 4th tab, and increase the number of tabs per row, so that all 5 tabs show up on the same row.

The second answer by jayeshshah shows how create one more tab than the current number of tabs and how to activate the tab created. Both solutions were helpful.

Now I see why vinnyd79 has so many points, that was quick!

josephfluckiger
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now