DOCUMENT:Q193021 23-SEP-1998 [vbwin] TITLE :BUG: SSTab Focus Given to a Control on a Non-Visible Tab PRODUCT :Microsoft Visual Basic for Windows PROD/VER:WINDOWS:5.0,6.0 OPER/SYS:WINDOWS KEYWORDS: ====================================================================== --------------------------------------------------------------------- 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. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. MORE INFORMATION ================ Steps to Reproduce Behavior --------------------------- 1. Start a new Standard EXE project in Visual Basic. Form1 is created by default. 2. 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." 3. Add a Tabbed Dialog Control (SSTab1) to Form1. There will be three tabs: Tab0, Tab1, and Tab2. 4. Add a CommandButton to each tab on the SSTab1. 5. On the second tab, Tab 1, add the following code to the Click event of the CommandButton on this tab: SSTab1.Caption = "changed" 6. Also on the second tab, set the Caption property of the CommandButton to "&Caption." 7. Run the project. 8. 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. 9. Now press the RIGHT ARROW key (->). Notice that no visible control has the focus. 10. Press the ENTER key. Notice the Tab 0 caption changes to "changed" showing that the middle tab's button was pressed. 11. Stop the project and run it again. 12. 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. 13. 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. REFERENCES ========== For additional information and possible workarounds, please see the following article in the Microsoft Knowledge Base: ARTICLE-ID: Q178469 TITLE : PRB: Focus on the Tab Control Changes to an Inactive Tab Additional query words: kbDSupport kbDSD tabctl32.ocx tabstrip tab strip Sheridan accelerator hot key kbVBp kbCtrl kbVBp600bug kbVBp500bug kbTabCtrl ====================================================================== Version : WINDOWS:5.0,6.0 Platform : WINDOWS Issue type : kbbug Solution Type : kbnofix ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1998.