ToolStripManager::Merge Method (ToolStrip^, String^)
Combines two ToolStrip objects of the same type.
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 targetName parameter.
- targetName
-
Type:
System::String^
The name of the ToolStrip that receives the ToolStrip referred to by the sourceToolStrip parameter.
| Exception | Condition |
|---|---|
| ArgumentNullException | The sourceToolStrip or targetName parameter is null. |
| ArgumentException | The sourceToolStrip or targetName parameters refer to the same ToolStrip. |
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.
Use the ToolStripManager::Merge method to combine ToolStrip objects of different types.
The ToolStrip::AllowMerge property must be set to true for both ToolStrip objects, and the source and target types must be identical, 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. |
Available since 2.0
