BUG: TabStrip Loses Selection When Placement Property is Changed (193399)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q193399 SYMPTOMS
When changing the Placement property of a TabStrip control (Placement
determines the location of the tabs: top, bottom, right, left), the
TabStrip may lose track of which Tab is selected. The selected Tab should
not change when the Placement is changed.
RESOLUTION
The workaround for this problem is straightforward. Because the TabStrip
may not retain the selected tab properly, you must do it programmatically.
This value can be stored in a variable at the beginning of the procedure
(or before changing the Placement property), and then restored at the end
of the procedure (or after changing the Placement property). The following
code will fix the problem as presented in step 7 of the Steps to Reproduce
Behavior section of this article:
Dim objSaveTab As Object
With TabStrip1
Set objSaveTab = .SelectedItem
If .Placement = 3 Then
.Placement = 0
Else
.Placement = TabStrip1.Placement + 1
End If
Set .SelectedItem = objSaveTab
Debug.Print .SelectedItem
End With
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products
listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 5/13/2003 |
---|
Keywords: | kbbug KB193399 |
---|
|