Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Add tabs to sstab control at runtime

Posted on 2003-11-08
3
Medium Priority
?
549 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 120 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 80 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

721 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