Export (0) Print
Expand All

ListView.SelectedIndexCollection.Contains Method

Determines whether the specified index is located in the collection.

[Visual Basic]
Public Function Contains( _
   ByVal selectedIndex As Integer _
) As Boolean
[C#]
public bool Contains(
 int selectedIndex
);
[C++]
public: bool Contains(
 int selectedIndex
);
[JScript]
public function Contains(
   selectedIndex : int
) : Boolean;

Parameters

selectedIndex
The index to locate in the collection.

Return Value

true if the specified index from the ListView.ListViewItemCollection for the ListView is an item in the collection; otherwise, false.

Remarks

The Contains method enables you to determine whether an index position from the ListView.ListViewItemCollection is one of the selected indexes stored in ListView.SelectedIndexCollection. Once you know that an item is in the selected index collection, you can use the IndexOf method to determine the position of the index in the ListView.SelectedIndexCollection.

Requirements

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

See Also

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

Show:
© 2015 Microsoft