BUG: Setting OptionButton Value to True Sets TabStop to True
ID: Q192089
|
The information in this article applies to:
-
Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, versions 5.0, 6.0
SYMPTOMS
Setting the Value property of an OptionButton equal to True, either by
setting it through code or clicking the radio button, the TabStop property
is also set to True.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article.
MORE INFORMATION
Steps to Reproduce Behavior
- Start a new Standard EXE project in Visual Basic. Form1 is created by
default.
- Add a CommandButton and an OptionButton to Form1.
- Add the following code to the form module:
Sub Form_Load()
Option1.TabStop = False
End Sub
Sub Form_Click()
Option1.Value = True
Debug.Print Option1.TabStop
End Sub
- Save the project and run it.
- Press the TAB key and note that you cannot tab between controls.
- Now click on the Form, which will set the Value property of the
OptionButton equal to True. The same behavior will occur if the
OptionButton is clicked with the mouse.
- Press the TAB key again. Note this time that you are able to tab to the
OptionButton. This occurs because setting the Value property to True
sets the TabStop property to True.
- To work around this bug, reset the TabStop property equal to False after
the Value property is set to True. In design-mode, modify the Form Click
event to look similar to the following:
Sub Form_Click()
Option1.Value = True
Option1.TabStop = False
Debug.Print Option1.TabStop
End Sub
- Repeat steps 4-7, and note that the OptionButton is never in the tabbing
sequence.
REFERENCES
For additional information, please see the following article in the
Microsoft Knowledge Base:
Q191720
: BUG: Option Button Value Changes When Group is Disabled
Additional query words:
kbDSupport kbDSD kbVBp kbCtrl kbVBp600bug kbVBp500bug
Keywords : kbGrpVB
Version : WINDOWS:5.0,6.0
Platform : WINDOWS
Issue type : kbbug