ListBox::IntegerCollection::IndexOf Method (Int32)

 

Retrieves the index within the ListBox::IntegerCollection of the specified integer.

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

public:
int IndexOf(
	int item
)

Parameters

item
Type: System::Int32

The integer for which to retrieve the index.

Return Value

Type: System::Int32

The zero-based index of the integer in the ListBox::IntegerCollection; otherwise, negative one (-1).

Use the IndexOf method to determine where an item is located within the collection. To determine whether an item is located within the collection before calling this method, use the Contains method.

.NET Framework
Available since 2.0
Return to top
Show: