FIX: Missing Controls on the SSTAB Control TabsLast reviewed: December 18, 1997Article ID: Q167107 |
The information in this article applies to:
SYMPTOMSOne or more of the tabs on the SSTAB control is missing its controls when displayed at run-time.
CAUSEThe SSTab control does not respond correctly when attempting to manipulate the Tab or TabVisible properties from the Form-Load event. If the SSTab control has not completely finished initializing when you attempt to set the Tab property to reflect a value different than the default, then the controls are still located in their temporary holding area at -72960. The Tab will display without its controls. To guarantee that the SSTab control has finished initializing, you can access its properties from any event after Form_Load has completed and the SSTab can receive the focus. This will occasionally work from the Form_Load event but has inconsistent behavior when you have various controls on one the tabs.
RESOLUTION
Tab PropertyIf you attempt to set a certain tab as the current tab on initial display, then setting the Tab property in either the Form_Activate event or the SSTab1.Got_Focus event instead of the Form_Load event fixes this problem, as follows:
Private Sub Form_Activate Static bReactivate as Boolean 'default is false If Not bReactivate Then SSTab1.Tab = GetSetting("MyApp","Settings","MyTab",0) bReactivate = True End If End Sub TabVisible PropertyIf you attempt to display only a certain tab on initial display, then setting the desired tab as the current tab and then setting the REMAINING tabs TabVisible property to false in reverse order (leaving the current tab set to visible) from either the Form_Activate event or the SSTab.Got_Focus events solves this problem, as follows:
Private Sub Form_Activate() Static bReactivate as Boolean 'default is false If Not bReactivate Then SSTab1.Tab = GetSetting("MyApp","Settings","MyTab",0) For i = SSTab1.Tabs - 1 To 0 Step -1 If SSTab1.Tab <> i Then SSTab1.TabVisible(i) = False End If Next i bReactivate = True End If End SubThis code assumes that have stored an entry "MyTab" in the registry. The GetSetting function can be replaced with a module level Public integer variable and set as needed.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual Studio 97 Service Pack 2. For more information on the Visual Studio 97 Service Pack 2, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q170365 TITLE : INFO: Visual Studio 97 Service Packs - What, Where, and WhyFor a list of the Visual Basic 5.0 bugs that were fixed in the Visual Studio 97 Service Pack 2, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q171554 TITLE : INFO: Visual Basic 5.0 Fixes in Visual Studio 97 Service Pack 2 MORE INFORMATION
Activate & Got_FocusIf you do not want the tab selected every time the SSTab control or the form its on receives focus, then use a Static flag such as bReactivate in the sample. If you do want the tab to be set every time the form receives focus, then remove the flag:
Private Sub Form_Activate SSTab1.Tab = GetSetting("MyApp","Settings","MyTab",0) End Sub Steps to Reproduce Behavior
SSTab ControlTab property:
REFERENCESFor more information, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q149328 TITLE : Selecting Invisible Tab Can Cause GPF with SSTab Control |
Additional query words: missing invisible
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |