System.Windows.Forms.MenuItem.CloneMenu Method

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

Syntax

public virtual MenuItem CloneMenu ()

Returns

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

Remarks

System.Windows.Forms.MenuItem objects cannot be used in more than one place unless you obtain a copy of the System.Windows.Forms.MenuItem. You can call this method to create a copy of this menu item for use in a System.Windows.Forms.ContextMenu, System.Windows.Forms.MainMenu, or other System.Windows.Forms.MenuItem within your application. 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