This documentation is archived and is not being maintained.

ListView.CheckedIndexCollection.IndexOf Method

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

[Visual Basic]
Public Function IndexOf( _
   ByVal checkedIndex As Integer _
) As Integer
public int IndexOf(
 int checkedIndex
public: int IndexOf(
 int checkedIndex
public function IndexOf(
   checkedIndex : int
) : int;


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

Return Value

The zero-based index in the collection where the specified index of the ListView.ListViewItemCollection is located within the ListView.CheckedIndexCollection. If the index is not located in the collection, the return value is negative one (-1).


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.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

ListView.CheckedIndexCollection Class | ListView.CheckedIndexCollection Members | System.Windows.Forms Namespace | Contains