ToolStripItemCollection Class
TOC
Collapse the table of content
Expand the table of content

ToolStripItemCollection Class

 

Represents a collection of ToolStripItem objects.

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

System.Object
  System.Windows.Forms.Layout.ArrangedElementCollection
    System.Windows.Forms.ToolStripItemCollection

[ListBindableAttribute(false)]
[UIPermissionAttribute(SecurityAction.InheritanceDemand, Window = UIPermissionWindow.AllWindows)]
public class ToolStripItemCollection : ArrangedElementCollection, 
	IList, ICollection, IEnumerable

NameDescription
System_CAPS_pubmethodToolStripItemCollection(ToolStrip, ToolStripItem[])

Initializes a new instance of the ToolStripItemCollection class with the specified container ToolStrip and the specified array of ToolStripItem controls.

NameDescription
System_CAPS_pubpropertyCount

Gets the number of elements in the collection.(Inherited from ArrangedElementCollection.)

System_CAPS_pubpropertyIsReadOnly

Gets a value indicating whether the ToolStripItemCollection is read-only.(Overrides ArrangedElementCollection.IsReadOnly.)

System_CAPS_pubpropertyItem[Int32]

Gets the item at the specified index.

System_CAPS_pubpropertyItem[String]

Gets the item with the specified name.

NameDescription
System_CAPS_pubmethodAdd(Image)

Adds a ToolStripItem that displays the specified image to the collection.

System_CAPS_pubmethodAdd(String)

Adds a ToolStripItem that displays the specified text to the collection.

System_CAPS_pubmethodAdd(String, Image)

Adds a ToolStripItem that displays the specified image and text to the collection.

System_CAPS_pubmethodAdd(String, Image, EventHandler)

Adds a ToolStripItem that displays the specified image and text to the collection and that raises the Click event.

System_CAPS_pubmethodAdd(ToolStripItem)

Adds the specified item to the end of the collection.

System_CAPS_pubmethodAddRange(ToolStripItem[])

Adds an array of ToolStripItem controls to the collection.

System_CAPS_pubmethodAddRange(ToolStripItemCollection)

Adds a ToolStripItemCollection to the current collection.

System_CAPS_pubmethodClear()

Removes all items from the collection.

System_CAPS_pubmethodContains(ToolStripItem)

Determines whether the specified item is a member of the collection.

System_CAPS_pubmethodContainsKey(String)

Determines whether the collection contains an item with the specified key.

System_CAPS_pubmethodCopyTo(Array, Int32)

Copies the entire contents of this collection to a compatible one-dimensional Array, starting at the specified index of the target array.(Inherited from ArrangedElementCollection.)

System_CAPS_pubmethodCopyTo(ToolStripItem[], Int32)

Copies the collection into the specified position of the specified ToolStripItem array.

System_CAPS_pubmethodEquals(Object)

Determines whether two ArrangedElementCollection instances are equal.(Inherited from ArrangedElementCollection.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodFind(String, Boolean)

Searches for items by their name and returns an array of all matching controls.

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator for the entire collection.(Inherited from ArrangedElementCollection.)

System_CAPS_pubmethodGetHashCode()

Returns the hash code for this instance.(Inherited from ArrangedElementCollection.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodIndexOf(ToolStripItem)

Retrieves the index of the specified item in the collection.

System_CAPS_pubmethodIndexOfKey(String)

Retrieves the index of the first occurrence of the specified item within the collection.

System_CAPS_pubmethodInsert(Int32, ToolStripItem)

Inserts the specified item into the collection at the specified index.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodRemove(ToolStripItem)

Removes the specified item from the collection.

System_CAPS_pubmethodRemoveAt(Int32)

Removes an item from the specified index in the collection.

System_CAPS_pubmethodRemoveByKey(String)

Removes the item that has the specified key.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Add(Object)

Adds an item to the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Clear()

Removes all items from the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Contains(Object)

Determines if the collection contains a specified item.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.IndexOf(Object)

Determines the location of a specified item in the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Insert(Int32, Object)

Inserts an item into the collection at a specified index.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Remove(Object)

Removes the first occurrence of a specified item from the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.RemoveAt(Int32)

Removes an item from the collection at a specified index.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.IsSynchronized

For a description of this member, see the ICollection.IsSynchronized property.(Inherited from ArrangedElementCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.SyncRoot

For a description of this member, see the ICollection.SyncRoot property.(Inherited from ArrangedElementCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIList.IsFixedSize

Gets a value indicating whether the collection has a fixed size.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIList.Item[Int32]

Retrieves the element at the specified index.

NameDescription
System_CAPS_pubmethodAsParallel()

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethodAsQueryable()

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethodCast<TResult>()

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethodOfType<TResult>()

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

The Add, Remove, and RemoveAt methods enable you to add and remove individual controls from the collection. You can also use the AddRange or Clear methods to add or remove all the controls from the collection.

You can determine whether a ToolStripItem is a member of the collection by passing the control into the Contains method. To get the index value of the location of a ToolStripItem in the collection, pass the control into the IndexOf method. The collection can be copied into an array by calling the CopyTo method.

.NET Framework
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft