语言

ListBox.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如果指定的索引是ListBox.ObjectCollectionListBox此集合中的项,则为 ;否则为 false。

注解

通过 Contains 该方法,可以确定类中的 ListBox.ObjectCollection 索引位置是否是存储在该类中的 ListBox.SelectedIndexCollection所选索引的成员。 可以使用此选项来确定是否选择了多重选择 ListBox 中的特定项。

适用于

另请参阅