System.Windows.Forms.ToolStripManager.Merge Method

Combines two System.Windows.Forms.ToolStrip objects of different types.

Syntax

public static bool Merge (ToolStrip sourceToolStrip, ToolStrip targetToolStrip)

Parameters

sourceToolStrip
The System.Windows.Forms.ToolStrip to be combined with the System.Windows.Forms.ToolStrip referred to by the targetToolStrip parameter.
targetToolStrip
The System.Windows.Forms.ToolStrip that receives the System.Windows.Forms.ToolStrip referred to by the sourceToolStrip parameter.

Returns

true if the merge is successful; otherwise, false.

Remarks

Use the ToolStripManager.Merge(ToolStrip, ToolStrip) method to combine System.Windows.Forms.ToolStrip objects of different types.

Use the ToolStripManager.Merge(ToolStrip, string) method to combine System.Windows.Forms.ToolStrip objects of identical type, such as System.Windows.Forms.ToolStrip objects with other System.Windows.Forms.ToolStrip objects, System.Windows.Forms.MenuStrip objects with other System.Windows.Forms.MenuStrip objects, and so on.

The ToolStrip.AllowMerge property must be set to true for both System.Windows.Forms.ToolStrip objects, or this method returns false.

Note:

If there are two System.Windows.Forms.MenuStrip controls on an MDI child form, setting Form.IsMdiContainer to true for the parent form merges the contents of only one of the System.Windows.Forms.MenuStrip controls. Use ToolStripManager.Merge(ToolStrip, string) to merge the contents of additional child System.Windows.Forms.MenuStrip controls on the MDI parent form.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0