BUG: The Popup event does not raise for the menu item of the Context Menu control that is associated with the Notify icon (814737)
The information in this article applies to:
- Microsoft .NET Framework 1.1
- Microsoft .NET Framework 1.0
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
- Microsoft Visual Basic 2005
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
- Microsoft .NET Framework 2.0
Beta InformationThis article discusses a Beta release of a Microsoft product. The information in this article is provided as-is and is subject to change without notice.
No formal product support is available from Microsoft for this Beta product. For information about how to obtain support for a Beta release, see the documentation that is included with the Beta product files, or check the Web location where you downloaded the release.SYMPTOMS When you right-click the Notify icon for a Microsoft .NET application, the Context Menu control associated with the Notify icon is displayed. If you point to the menu items, the submenu
items are displayed. However, the menu items Popup event does not raise before the submenu items are displayed.
Therefore, the code associated with the menu items Popup event, such as adding submenu items dynamically, does not
run.WORKAROUNDTo work around this bug, do one of the following
things: - Associate the Context Menu with the Windows Form.
- Use the Context Menu control Popup event instead of the menu items Popup event of the Context Menu control.
To use the Context Menu control Popup event to work around this bug, add the following code in the Context Menu control Popup event handler: Microsoft Visual Basic .NET or Microsoft Visual Basic 2005 Code Private Sub ContextMenu1_Popup(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ContextMenu1.Popup
' Add a menu item dynamically
Dim mnuSubItem As New MenuItem("SubMenu2")
MenuItem1.MenuItems.Add(mnuSubItem)
End Sub Microsoft Visual C# .NET Code private void contextMenu1_Popup(object sender, System.EventArgs e)
{
// Add a menu item dynamically
MenuItem mnuItem;
mnuItem = new MenuItem("SubMenu2");
menuItem1.MenuItems.Add(mnuItem);
} STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kbvs2002sp1sweep kbMenu kbControl kbCtrl kbContMenu kbbug KB814737 kbAudDeveloper |
---|
|