System.Windows.Forms.MenuItem.CloneMenu Method

Creates a copy of the specified System.Windows.Forms.MenuItem.

Syntax

protected void CloneMenu (MenuItem itemSrc)

Parameters

itemSrc
The System.Windows.Forms.MenuItem that represents the menu item to copy.

Returns

A System.Windows.Forms.MenuItem that represents the duplicated menu item.

Remarks

Call this method to create copies of menu items that you have already created for use in a shortcut menu or another menu structure within your application. This version of MenuItem.CloneMenu allows you to specify a specific System.Windows.Forms.MenuItem to copy instead of the menu item that is calling the method. You can use this method to initialize a new System.Windows.Forms.MenuItem object with a copy of another System.Windows.Forms.MenuItem. When a menu item is cloned, any event handlers specified in the original menu item will continue to function in the cloned version of the menu item. For example, if you created a System.Windows.Forms.MenuItem and connected its MenuItem.Click event to an event handler. When the menu item is cloned, the cloned menu item will call the same event handler.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0