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