BUG: Incorrect Focus Shift for Disabled Control in Break Mode

Last reviewed: August 11, 1997
Article ID: Q77734

The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, versions 2.0 and 3.0
- Microsoft Visual Basic programming system for Windows, version 1.0

SYMPTOMS

In Break mode in the Microsoft Visual Basic environment (VB.EXE), disabling a control or making a control invisible does not shift the focus to the next control in the tab order. Instead, the focus remains on the disabled control.

At run time, the focus correctly shifts to the next control in the tab order.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

  1. From the File menu, choose New Project.

  2. Place two controls on Form1 (in this example, two command buttons).

  3. From the Run menu, choose Start.

  4. From the Run menu, choose Break.

  5. In the Immediate window, type the following:

          Command1.SetFocus
          Command1.Enabled = 0
          Print Screen.ActiveControl.Caption
    

    The active control will be Command1.

  6. From the Run menu, choose Continue.

    Note: The disabled control, Command1, will still have the focus. To shift the focus to the next control in the tab index, press the TAB key.

If the example code from step 5 above is used at run time, the focus will correctly shift from Command1 to Command2.
Keywords          : buglist3.00 EnvtDes buglist1.00 buglist2.00 kbenv kbbuglist kbtlc
Version           : 1.0 2.0 3.0
Platform          : WINDOWS
Issue type        : kbbug


================================================================================


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.

Last reviewed: August 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.