语言

ListView.CheckedListViewItemCollection.IndexOf(ListViewItem) 方法

定义

返回指定项集合中的索引。

public:
 int IndexOf(System::Windows::Forms::ListViewItem ^ item);
public int IndexOf(System.Windows.Forms.ListViewItem item);
member this.IndexOf : System.Windows.Forms.ListViewItem -> int
Public Function IndexOf (item As ListViewItem) As Integer

参数

item
ListViewItem

一个 ListViewItem 表示在集合中查找的项。

返回

集合中项的从零开始的索引;否则为 -1。

注解

一旦知道某个项位于集合中(使用Contains该方法),就可以使用IndexOf该方法来确定存储其中ListView.ListViewItemCollection特定项ListView的位置ListView.CheckedListViewItemCollection。

适用于

另请参阅