This documentation is archived and is not being maintained.

ListView.CheckedListViewItemCollection.Contains Method

Determines whether the specified item is located in the collection.

[Visual Basic]
Public Function Contains( _
   ByVal item As ListViewItem _
) As Boolean
[C#]
public bool Contains(
 ListViewItem item
);
[C++]
public: bool Contains(
 ListViewItem* item
);
[JScript]
public function Contains(
   item : ListViewItem
) : Boolean;

Parameters

item
A ListViewItem representing the item to locate in the collection.

Return Value

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

Remarks

The Contains method enables you to determine whether an item from the ListView.ListViewItemCollection is a one of the checked items stored in the ListView.CheckedListViewItemCollection. Once you know that an item is in the checked item collection, you can use the CheckedListViewItemCollection.IndexOf method to determine the position of the item in the ListView.CheckedListViewItemCollection.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

ListView.CheckedListViewItemCollection Class | ListView.CheckedListViewItemCollection Members | System.Windows.Forms Namespace | IndexOf

Show: