Export (0) Print
Expand All

ListView.CheckedListViewItemCollection.IndexOf Method

Returns the index within the collection of the specified item.

[Visual Basic]
Public Function IndexOf( _
   ByVal item As ListViewItem _
) As Integer
[C#]
public int IndexOf(
 ListViewItem item
);
[C++]
public: int IndexOf(
 ListViewItem* item
);
[JScript]
public function IndexOf(
   item : ListViewItem
) : int;

Parameters

item
A ListViewItem representing the item to locate in the collection.

Return Value

The zero-based index of the item in the collection; otherwise, -1.

Remarks

Once you know that an item is located within the collection (using the Contains method), you can use the IndexOf method to determine where a specific item within the ListView.ListViewItemCollection for the ListView is stored within the ListView.CheckedListViewItemCollection.

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.CheckedListViewItemCollection Class | ListView.CheckedListViewItemCollection Members | System.Windows.Forms Namespace | Contains

Show:
© 2015 Microsoft