ListView.CheckedIndexCollection.IndexOf(Int32) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从ListView.CheckedIndexCollection列表视图控件返回指定索引内的ListView.ListViewItemCollection索引。
public:
int IndexOf(int checkedIndex);
public int IndexOf(int checkedIndex);
member this.IndexOf : int -> int
Public Function IndexOf (checkedIndex As Integer) As Integer
参数
- checkedIndex
- Int32
集合中要查找的 ListView.ListViewItemCollection 从零开始的索引。
返回
集合中指定索引所在的ListView.ListViewItemCollection集合中从零开始的索引ListView.CheckedIndexCollection;否则,如果索引不在集合中,则 -1。
注解
一旦知道某个项位于选中的索引集合中(使用 Contains 该方法),就可以使用 IndexOf 该方法来确定索引在中的 ListView.CheckedIndexCollection位置。