语言

ListView.CheckedIndexCollection.Contains(Int32) 方法

定义

确定指定的索引是否位于集合中。

public:
 bool Contains(int checkedIndex);
public bool Contains(int checkedIndex);
member this.Contains : int -> bool
Public Function Contains (checkedIndex As Integer) As Boolean

参数

checkedIndex
Int32

在集合中查找的索引。

返回

true如果集合中指定索引ListView.ListViewItemCollectionListView是集合中的项,则为 ;否则为 false。

注解

通过该方法 Contains ,可以确定索引 ListView.ListViewItemCollection 位置是否为存储在其中检查的 ListView.CheckedIndexCollection索引之一。 知道某个项位于选中的索引集合中后,可以使用该方法 IndexOf 来确定索引在中的 ListView.CheckedIndexCollection位置。

适用于

另请参阅