ListView::SelectedIndexCollection::Add Method (Int32)
.NET Framework (current version)
Adds the item at the specified index in the Items array to the collection.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- itemIndex
-
Type:
System::Int32
The index of the item in the Items collection to be added to the ListView::SelectedIndexCollection.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | The specified index is less than 0 or greater than or equal to the number of items in the owner ListView. -or- The owner ListView is in virtual mode, and the specified index is less than 0 or greater than or equal to the value of VirtualListSize. |
This method will return 0 if the handle has not been created for the owning ListView. (You can determine whether the ListView has an associated handle by using the Control::IsHandleCreated property.) This method will return -1 if the handle has not been created for a virtual ListView.
.NET Framework
Available since 2.0
Available since 2.0
Show: