01-13-2005, 07:16 AM
I am using an SSTab control on a form. This control has three defined tabs and then each of the tabs pages has a selection of Label controls and Textbox controls. I am able to switch the pages just fine on the SSTab control at design time and see the separate controls on each page.
However at run time the controls only show on the SSTab page that was last selected at design time. If I click on different tabs at run time to show other pages of the SSTab control these other pages display with none of the controls visible.
Does anyone know why this may be happening? I am programming in VB6 with the SP6 installed.
Maybe there is a workaround to force the controls on the currently selected page to be displayed properly. I tried coding up some things but could not get any of it to compile or work correctly. Does anyone have a suggested workaround?
01-13-2005, 08:54 AM
The Tabs of the SSTab control don't serve as individual control containers, so you need upon selection of a Tab to specify which controls are visible and which are invisible.
My recommendation is to place the controls for each tab within their own Frame or PictureBox control and then upon selection of a given tab, make the Frame/PictureBox control that is to be associated with that tab visible and the others invisible.
01-13-2005, 09:40 AM
I think you got that mixed up. It is in fact the SSTab control that acts as a control container for all of the tabs. What you are refering to is the Common Controls tab control that doesn't act as a control container.
For mrakas i would suggest that you close and reopen the project, and make sure that all the controls are hosted within the tab-control and not within the form, ie. select all controls for tab 1, hit Ctrl+X (to cut), click the tab control on page 1, and hit Ctrl+V (to paste) and align them. This hopefully solvs it.
If you want more flexibility with your tabs, have a look around for XTabs (search this forum, i wrote a post about it a while ago) which is basically everything the SSTabs is plus a few extras :)
01-13-2005, 03:14 PM
The SSTab control acts as a container but the Tabs on the control do not. That was the point that I was making and the work-around using "sub-containers" controlled by Tab selection.
01-13-2005, 08:36 PM
Hm, either i'm not quite getting you or the other way around :) i'm always using the SSTab control just because i can place the controls for tab 1 on tab 1, the controls for tab 2 on tab 2 etc. so every tab in a SSTab is indeed a separate container.
01-14-2005, 06:34 AM
Either you were correct in the first place and I was indeed thinking of the TabStrip control or, whatever happened way-back-when that caused me to take the route of the "sub-containers" is no longer an issue because I'm unable to duplicate mkaras problem. I'll go check the Fix-Lists for the service packs. Maybe it used to be an issue and was corrected.
Anyways, lazerfisk is correct. Each Tab should only display the controls placed within it at run-time.
Okay. I should read the Bug-Fix list more often. This problem was apparently addressed in Service Pack 2 of VB5 (KB Article Q167107) and the solution of using "sub-containers" must have come from KB Article Q206904. This means that I've been using the same workaround for an issue that hasn't really been an issue for years now. :(