ToolStripManager::Merge Method (ToolStrip^, ToolStrip^)
Combines two ToolStrip objects of different types.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- sourceToolStrip
-
Type:
System.Windows.Forms::ToolStrip^
The ToolStrip to be combined with the ToolStrip referred to by the targetToolStrip parameter.
- targetToolStrip
-
Type:
System.Windows.Forms::ToolStrip^
The ToolStrip that receives the ToolStrip referred to by the sourceToolStrip parameter.
Use the ToolStripManager::Merge method to combine ToolStrip objects of different types.
Use the ToolStripManager::Merge method to combine ToolStrip objects of identical type, such as ToolStrip objects with other ToolStrip objects, MenuStrip objects with other MenuStrip objects, and so on.
The ToolStrip::AllowMerge property must be set to true for both ToolStrip objects, or this method returns false.
Note |
|---|
If there are two MenuStrip controls on an MDI child form, setting IsMdiContainer to true for the parent form merges the contents of only one of the MenuStrip controls. Use Merge to merge the contents of additional child MenuStrip controls on the MDI parent form. |
The following code example merges menu items based on specified choices. This example is part of a larger example available in the ToolStripManager class overview.
Available since 2.0
