This documentation is archived and is not being maintained.

ListViewItem.Index Property

Gets the zero-based index of the item within the list view control.

[Visual Basic]
Public ReadOnly Property Index As Integer
[C#]
public int Index {get;}
[C++]
public: __property int get_Index();
[JScript]
public function get Index() : int;

Property Value

The zero-based index of the item within the ListView control's ListView.ListViewItemCollection. If the item is not associated with a ListView control, this property returns -1.

Remarks

You can use this property to determine if the item is associated with a ListView control as well as to determine its position within the ListView.ListViewItemCollection of the ListView.

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

ListViewItem Class | ListViewItem Members | System.Windows.Forms Namespace

Show: