June 2003
Intermediate to advanced
800 pages
34h 20m
English
You want to create a context menu that shows the same entries as part of an application main menu.
Use the CloneMenu method to duplicate a portion of the main menu.
In many applications, a control’s context-sensitive menu duplicates a portion of the main menu. Unlike Visual Basic 6, .NET differentiates between context menus and main menus, and a menu item can only belong to one menu at a time.
The solution is to make a duplicate copy of a portion of the menu using the CloneMenu method. The CloneMenu method not only copies the appropriate MenuItem items (and any contained submenus), it also registers the MenuItem with the same event handlers. Thus, when a user clicks a cloned menu ...
Read now
Unlock full access