ToolStripManager::Merge Method (ToolStrip^, ToolStrip^)

 

Combines two ToolStrip objects of different types.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
static bool Merge(
	ToolStrip^ sourceToolStrip,
	ToolStrip^ targetToolStrip
)

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.

Return Value

Type: System::Boolean

true if the merge is successful; otherwise, false.

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.

System_CAPS_noteNote

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.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: