What is the purpose of CloneMenu()?
- CloneMenu() method copies the whole list of MenuItem objects into the current menu.
- It accepts a parameter of the type menu.
- It can be used in a derived class to clone MenuItem objects.
- They can then be reused by other classes that derive from the menu.
- It creates a copy of a MenuItem.
- This method can be called without arguments to create a duplicate copy of the MainMenu object.
- This method keeps all the event handlers intact, and is useful when you need to reuse the same entries in a context menu as in a main menu.
CloneMenu overload list:
1. CloneMenu(): It creates a copy of the current MenuItem.
2. CloneMenu(): It copies the menu that is passed as a parameter to the current menu.
3. CloneMenu(MenuItem): It creates a copy of the specified MenuItem.Syntax:
protected internal void CloneMenu (Menu menuSource)
- CloneMenu() method appends on entire structure to a menu item.