What is the purpose of CloneMenu? - DOT.NET

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.
Explain how to dynamically add items to a menu in .NET - DOT.NET
Following answer provides a very generalized idea of how this can be done: The first step would be locating the Assembly DLL....
Explain how to dynamically clone a menu in .NET - DOT.NET
Follow the steps below to dynamically clone a menu in .NET: Create an alternate MainMenu object, Clone the first menu with the CloneMenu method....
What is garbage collection? - DOT.NET
The applications created acquire memory. Memory management includes deallocating this acquired resources and acquiring them.....
Post your comment