Microsoft KB Archive/79602

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

Article ID: 79602

Article Last Modified on 12/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Standard Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 2.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 1.0 Standard Edition

-



This article was previously published under Q79602



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.



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.
 * 2) Add two option buttons to Form1.
 * 3) From the Run menu, choose Start (ALT, R, S) to run the program.
 * 4) 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.
 * 5) 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 query words: buglist1.00 buglist2.00 buglist3.00 2.00 3.00

Keywords: kbbug KB79602

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.