ToolboxItemCollection.Contains Method (ToolboxItem)

 

Indicates whether the collection contains the specified ToolboxItem.

Namespace:   System.Drawing.Design
Assembly:  System.Drawing (in System.Drawing.dll)

public bool Contains(
	ToolboxItem value
)

Parameters

value
Type: System.Drawing.Design.ToolboxItem

A ToolboxItem to search the collection for.

Return Value

Type: System.Boolean

true if the collection contains the specified object; otherwise, false.

The following code example demonstrates using the Contains method of a ToolboxItemCollection.

// If the collection contains the specified ToolboxItem, 
// retrieve the collection index of the specified item.
int indx = -1;
if( collection.Contains( item ) )
    indx = collection.IndexOf( item );

.NET Framework
Available since 1.1
Return to top
Show: