FIX: Wrong Menu Click Event After Hiding Menu (99872)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 2.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
- Microsoft Visual Basic Standard Edition for Windows 1.0
- Microsoft Visual Basic Standard Edition for Windows 2.0
- Microsoft Visual Basic Standard Edition for Windows 3.0
This article was previously published under Q99872 SYMPTOMS
The wrong menu Click event is executed after hiding and showing menu
items in Visual Basic.
CAUSE
This problem occurs when a menu is made invisible before another
menu item is made visible.
WORKAROUND
Change the order followed to make menus visible and invisible. For example
replace the following code (listed in step 4 in the More Information
section below):
Sub Command1_Click ()
MnuFile.Visible = 0
MnuEdit.Visible = -1
End Sub
Sub Command2_Click ()
MnuEdit.Visible = 0
MnuFile.Visible = -1
End Sub
with this code:
Sub Command1_Click ()
MnuEdit.Visible = -1
MnuFile.Visible = 0
End Sub
Sub Command2_Click ()
MnuFile.Visible = -1
MnuEdit.Visible = 0
End Sub
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This problem has been corrected in Visual
Basic version 4.0.
Modification Type: | Major | Last Reviewed: | 12/12/2003 |
---|
Keywords: | kbbug kbfix KB99872 |
---|
|