ListBox.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 若 中指定的索引 ListBox.ObjectCollection 是 ListBox 集合中的項目;否則, false。
備註
此 Contains 方法可讓您判斷類別中的 ListBox.ObjectCollection 索引位置是否屬於儲存在 ListBox.SelectedIndexCollection的選取索引成員。 你可以用這個來判斷多重選擇 ListBox 中是否選中了特定項目。