ListBox.ObjectCollection.Contains(Object) ListBox.ObjectCollection.Contains(Object) ListBox.ObjectCollection.Contains(Object) ListBox.ObjectCollection.Contains(Object) Method

定義

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

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

參數

value
Object Object Object Object

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

傳回

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

實作

例外狀況

備註

Contains方法可讓您判斷物件是否為集合的成員。The Contains method enables you to determine whether an object is a member of the collection. 一旦您知道項目位於集合中,您可以使用IndexOf方法,以判斷項目位於集合。Once you know that the item is located within the collection, you can use the IndexOf method to determine where the item is located within the collection.

適用於

另請參閱