FIX: Missing Controls on the SSTAB Control Tabs (167107)
The information in this article applies to:
- Microsoft Visual Basic Control Creation Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q167107 SYMPTOMS
One or more of the tabs on the SSTAB control is missing its controls when
displayed at run-time.
CAUSE
The 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.
RESOLUTIONTab Property
If 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 Property
If 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 Sub
This 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.
- You should not make the current tab invisible using
SSTab1.TabVisible() = False.
- You should not set an invisible tab as the current tab.
- You should always leave at least one 'tab' set to visible. If you want
to make all the tabs invisible, use SSTab1.Visible = False
STATUS
Microsoft 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:
170365
: INFO: Visual Studio 97 Service Packs - What, Where, and Why
For 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:
171554
: INFO: Visual Basic 5.0 Fixes in Visual Studio 97 Service Pack 2
REFERENCES
For more information, please see the following article in the Microsoft
Knowledge Base:
149328
: Selecting Invisible Tab Can Cause GPF with SSTab Control
Modification Type: | Major | Last Reviewed: | 6/24/2004 |
---|
Keywords: | kbbug kbfix KB167107 |
---|
|