ListBox::SelectedObjectCollection::Contains Method (Object^)

 

Determines whether the specified item is located within the collection.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
virtual bool Contains(
	Object^ selectedObject
) sealed

Parameters

selectedObject
Type: System::Object^

An object representing the item to locate in the collection.

Return Value

Type: System::Boolean

true if the specified item is located in the collection; otherwise, false.

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. You can use this to determine if a specific item in a multiple-selection ListBox is selected.

.NET Framework
Available since 1.1
Return to top
Show: