ListBox.SelectedObjectCollection.Contains(Object) 方法

定義

判斷指定的項目是否位於集合中。Determines whether the specified item is located within the collection.

public:
 virtual bool Contains(System::Object ^ selectedObject);
public bool Contains (object selectedObject);
abstract member Contains : obj -> bool
override this.Contains : obj -> bool
Public Function Contains (selectedObject As Object) As Boolean

參數

selectedObject
Object

表示位於集合中項目的物件。An object representing the item to locate in the collection.

傳回

如果指定的項目位於集合中,則為 true,否則為 falsetrue if the specified item is located in the collection; otherwise, false.

實作

備註

Contains 方法可讓您判斷來自 ListBox.ObjectCollection 類別的專案是否為儲存在 ListBox.SelectedObjectCollection中之選定專案的成員。The Contains method enables you to determine whether an item from the ListBox.ObjectCollection class is a member of the selected items stored in the ListBox.SelectedObjectCollection. 您可以使用此專案來判斷是否已選取多重選取 ListBox 中的特定專案。You can use this to determine if a specific item in a multiple-selection ListBox is selected.

適用於

另請參閱