BUG: Windowless OptionButton Events Not in Correct Order
ID: Q190038
|
The information in this article applies to:
-
Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, version 6.0
SYMPTOMS
The events of a Windowless OptionButton do not fire in the correct sequence
when navigating with ARROW keys.
RESOLUTION
Use the windowed intrinsic Visual Basic OptionButton instead of the
windowless (Lightweight) OptionButton control.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. We are researching this bug and will post
new information here in the Microsoft Knowledge Base as it becomes
available.
MORE INFORMATION
The proper sequence is the following order: the LostFocus event of the
previous control followed by the GotFocus and Click events of the active
control.
Instead, the order when navigating with the ARROW keys is the
following: the Click event of the active control, then the LostFocus event
of the previous control, followed by the GotFocus event of the active
control.
NOTE: The Microsoft Windowless Controls are not part of the default Visual
Basic installation. Please refer to the REFERENCES section below for
details.
Steps to Reproduce Behavior
- Create a new Standard EXE project. Form1 is created by default.
- Using the Projects menu, select Components to bring up the Components
dialog box. On the Controls Tab, check "Microsoft Windowless Controls."
Then click OK.
- Add a Frame, Frame1, to Form1.
- Add two Windowless OptionButtons, WLOption1 and WLOption2, to Frame1.
- Add the following code to Form1:
Private Sub WLOption1_Click()
Debug.Print "WLOption1_Click"
End Sub
Private Sub WLOption1_GotFocus()
Debug.Print "WLOption1_GotFocus"
End Sub
Private Sub WLOption1_LostFocus()
Debug.Print "WLOption1_LostFocus"
End Sub
Private Sub WLOption2_Click()
Debug.Print "WLOption2_Click"
End Sub
Private Sub WLOption2_GotFocus()
Debug.Print "WLOption2_GotFocus"
End Sub
Private Sub WLOption2_LostFocus()
Debug.Print "WLOption2_LostFocus"
End Sub
- Run the Project.
- Click on the OptionButtons with the mouse. When the OptionButtons are
navigated by clicking with the mouse, the events are fired in the proper
order:
LostFocus
GotFocus
Click
- Use the ARROW keys to navigate between the OptionButtons. When the
OptionButtons are navigated by using the ARROW keys, the events are not
fired in the proper order:
Click
LostFocus
GotFocus
REFERENCES
For additional information, please see the following article in the
Microsoft Knowledge Base:
Q189950 HOWTO: Install the Microsoft Windowless Controls for VB6
Additional query words:
kbDSupport kbDSD Option Button kbVBp kbCtrl kbVBp600bug radio
Keywords : kbGrpVB
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbbug