Solved

Add tabs to sstab control at runtime

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

776 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