ListView.CheckedIndexCollection.IndexOf Method (Int32)


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

Returns the index within the System.Windows.Forms.ListView.CheckedIndexCollection of the specified index from the ListView.ListViewItemCollection of the list view control.

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

public int IndexOf(
	int checkedIndex


Type: System.Int32

The zero-based index from the ListView.ListViewItemCollection to locate in the collection.

Return Value

Type: System.Int32

The zero-based index in the collection where the specified index of the ListView.ListViewItemCollection is located within the ListView.CheckedIndexCollection; otherwise, -1 if the index is not located in the collection.

Once you know that an item is in the checked index collection (using the Contains method), you can use the IndexOf method to determine the position of the index in the ListView.CheckedIndexCollection.

.NET Framework
Available since 1.1
Return to top