Option Button with Focus May Be Set when Form Caption Clicked

ID Number: Q79602

1.00

WINDOWS

buglist1.00

Summary:

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 or Maximize

button, control menu box, or form size handles. This is abnormal

behavior in the Windows environment and does not occur with other

Windows programs.

An option button Click event will also incorrectly occur 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.

Microsoft has confirmed this to be a problem in Visual Basic

programming system version 1.0 for Windows. We are researching this

problem and will post new information here as it becomes available.

More Information:

Steps to Reproduce Problem Described in First Paragraph Above

-------------------------------------------------------------

1. Run Visual Basic. From the File menu, choose New Project (ALT, F,

N). Form1 will be created by default.

2. Create two option buttons on 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 on the unselected option button and holding down the mouse

button until you have moved the mouse cursor completely off of the

form.

5. Click the form's title bar, control menu box, Minimize or Maximize

button, or the resize handles. This will result in the option

button being selected.

Additional reference words: 1.00