语言

ListView.SelectedIndexCollection.Contains(Int32) 方法

定义

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

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位置。

适用于

另请参阅