Solved

Add tabs to sstab control at runtime

Posted on 2003-11-08
3
537 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

910 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

23 Experts available now in Live!

Get 1:1 Help Now