ListView::SelectedListViewItemCollection::IndexOf Method (ListViewItem^)
.NET Framework (current version)
Returns the index within the collection of the specified item.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- item
-
Type:
System.Windows.Forms::ListViewItem^
A ListViewItem representing the item to locate in the collection.
Return Value
Type: System::Int32The zero-based index of the item in the collection. If the item is not located in the collection, the return value is negative one (-1).
Once you know that an item is in the selected item collection (using the Contains method), you can use the IndexOf method to determine the position of the item in the ListView::SelectedListViewItemCollection.
.NET Framework
Available since 1.1
Available since 1.1
Show: