DesignerVerbCollection.IndexOf Method (DesignerVerb)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the index of the specified DesignerVerb.

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

public int IndexOf(
	DesignerVerb value
)

Parameters

value
Type: System.ComponentModel.Design.DesignerVerb

The DesignerVerb whose index to get in the collection.

Return Value

Type: System.Int32

The index of the specified object if it is found in the list; otherwise, -1.

The following code example demonstrates how to test for the presence of a DesignerVerb in a DesignerVerbCollection.

// Tests for the presence of a DesignerVerb in the collection, 
// and retrieves its index if it is found.
DesignerVerb testVerb = new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent));
int itemIndex = -1;
if( collection.Contains( testVerb ) )
    itemIndex = collection.IndexOf( testVerb );

.NET Framework
Available since 1.1
Return to top
Show: