BUG: Incorrect Popup Menu Events Fired with Invisible Menus (116058)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 2.0
- Microsoft Visual Basic Standard Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition for Windows 2.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
This article was previously published under Q116058 SYMPTOMS
When the following conditions are met, Visual Basic may incorrectly fire a
menu's Click event for the first visible menu item under the first menu on
the form: - You use the PopupMenu method to display a menu that has its Visible
property set to False.
- The PopupMenu is not the first (leftmost) menu on the form, and the
first menu on the form also has its Visible property set to False.
Under these conditions, the Click event for the first visible menu item on
the first menu will be fired immediately after the PopupMenu method is
called, so the desired PopupMenu will not be displayed.
WORKAROUND
To work around this problem, either: - Make the first menu on the form visible.
-or-
- Place all popup menus on a separate form. Then you can leave all the
menus on your popup menus visible, but make the form that contains
them invisible. To make the form invisible, set the form's visible
property to false. You can invoke popup menus from other forms by
referring to the form name and then the menu name, as in this example:
PopupMenu Form2.Menu2
STATUS
Microsoft has confirmed this to be a bug in Visual Basic version 3.0. We
are researching this problem and will post new information here in the
Microsoft Knowledge Base as it becomes available.
Modification Type: | Major | Last Reviewed: | 12/9/2003 |
---|
Keywords: | kbbug KB116058 |
---|
|