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