ListView::ListViewItemCollection::IndexOf Method (ListViewItem^)

 

Returns the index within the collection of the specified item.

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

public:
int IndexOf(
	ListViewItem^ item
)

Parameters

item
Type: System.Windows.Forms::ListViewItem^

A ListViewItem representing the item to locate in the collection.

Return Value

Type: System::Int32

The zero-based index of the item's location in the collection; otherwise, -1 if the item is not located in the collection.

The IndexOf method enables you to determine the position of an item in the collection. To determine whether an item is contained in the collection before calling this method, use the Contains method.

.NET Framework
Available since 1.1
Return to top
Show: