BUG: SSTab Focus Given to a Control on a Non-Visible Tab
ID: Q193021
|
The information in this article applies to:
-
Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, versions 5.0, 6.0
SYMPTOMS
Pressing an ARROW key when a control contained on a SSTab has the focus may
cause focus to be transferred to a control on a Tab that is not visible.
The behavior also occurs if the control on a Tab that is not visible has an
access key (ex. Command2.Caption = "&Command2"). The control's Click event
can be accessed by pressing the ALT+C key combination, even though the
control is on a tab that is not visible.
RESOLUTION
To work around this bug behavior, set the focus to the Tab with the control in the Lost Focus event of the last control in the Tab. If you created the sample project, add the following code to the Form1 code window:
Private Sub Command1_LostFocus()
SSTab1.Tab = 1
SSTab1.SetFocus
End Sub
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products
listed at the beginning of this article.
MORE INFORMATIONSteps to Reproduce Behavior
- Start a new Standard EXE project in Visual Basic. Form1 is created
by default.
- Add a reference to the Microsoft Tabbed Dialog Control 5.0/6.0 by
clicking Components from the Project Menu and checking "Microsoft Tabbed
Dialog Control 5.0/6.0."
- Add a Tabbed Dialog Control (SSTab1) to Form1. There will be three
tabs: Tab0, Tab1, and Tab2.
- Add a CommandButton to each tab on the SSTab1.
- On the second tab, Tab 1, add the following code to the Click event of
the CommandButton on this tab:
SSTab1.Caption = "changed"
- Also on the second tab, set the Caption property of the CommandButton
to "&Caption."
- Run the project.
- Click on the first tab, Tab 0, of the SSTab1 and hit the TAB key to
move the focus to the CommandButton on Tab 0.
- Now press the RIGHT ARROW key (->). Notice that no visible control has
the focus.
- Press the ENTER key. Notice the Tab 0 caption changes to "changed"
showing that the middle tab's button was pressed.
- Stop the project and run it again.
- Click on the first tab, Tab 0, of the SSTab1 and hit the TAB key to
move the focus to the CommandButton on Tab 0.
- Press the ALT+C key combination. Note that the Tab 0 caption changes
to "changed," showing that the middle tab's button was pressed.
The Click event of the CommandButton fires in both cases, the ARROW key
and the ACCESS key, even when the tab is not visible.
Additional query words:
Keywords : kbCtrl kbTabCtrl kbVBp kbVBp500bug kbVBp600bug kbDSupport
Version : WINDOWS:5.0,6.0
Platform : WINDOWS
Issue type : kbbug
|