System.Windows.Forms.ToolStripItemCollection.Clear Method

Removes all items from the collection.

Syntax

public virtual void Clear ()

Remarks

Use the ToolStripItemCollection.Clear method to remove the entire collection of controls from a parent control.

To remove an individual control from the collection, use the ToolStripItemCollection.Remove(ToolStripItem) or ToolStripItemCollection.RemoveAt(int) method.

To add new System.Windows.Forms.ToolStripItem controls to the System.Windows.Forms.ToolStripItemCollection, use the ToolStripItemCollection.Add(ToolStripItem) or ToolStripItemCollection.AddRange(ToolStripItem[]) method.

Requirements

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