ListView.SelectedListViewItemCollection.IndexOf(ListViewItem) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回指定项集合中的索引。
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
在集合中查找的项。
返回
集合中项的从零开始的索引。 如果项不在集合中,则返回 -1。
注解
一旦知道某个项位于所选项集合中(使用 Contains 该方法),就可以使用 IndexOf 该方法来确定项在项 ListView.SelectedListViewItemCollection中的位置。