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
[C#]
public int IndexOf(
 int checkedIndex
);
[C++]
public: int IndexOf(
 int checkedIndex
);
[JScript]
public function IndexOf(
   checkedIndex : int
) : int;

Parameters

checkedIndex
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).

Remarks

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.

Requirements

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

Show: