BUG: Option Button w/ Focus Selected When Click Form Caption

Last reviewed: June 21, 1995
Article ID: Q79602
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 Visual Basic, if you run a program that contains an option button group, and one of the option buttons is not selected but has the focus, that option button will be selected -- causing the option button Click event -- when you select the form title bar, Minimize button, Maximize button, control menu box, or form size handles. This is does not occur with other Windows programs.

An option button Click event will also occur incorrectly on a form Load event if the option button is the only control on the form or if the option button's TabIndex property is set to 0. When the TabIndex property is 0, the option button is the control that gets the focus, causing a Click event for the option button. Putting another control on the form and setting that control's TabIndex to 0 solves the problem.

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 Described in First Paragraph Above

1. Start Visual Basic or from the File menu, choose New Project (ALT, F, N)
   if Visual Basic is already running. Form1 is created by default.

  • Add two option buttons to Form1.

  • From the Run menu, choose Start (ALT, R, S) to run the program.

  • Give the unselected option button the focus. This can be done by clicking the unselected option button and holding down the mouse button until you have moved the mouse cursor off of the form completely.

  • Click the form's title bar, control menu box, Minimize/Maximize button, or the resize handles. This will result in the option button being selected.


  • Additional reference words: buglist1.00 buglist2.00 buglist3.00 1.00 2.00
    3.00
    KBCategory: kbprg kbbuglist
    KBSubcategory: PrgCtrlsStd


    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: June 21, 1995
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.