語言

ListViewItem.Index 屬性

定義

取得控制項目 ListView 的零基索引。

public:
 property int Index { int get(); };
[System.ComponentModel.Browsable(false)]
public int Index { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Index : int
Public ReadOnly Property Index As Integer

屬性值

控制項內ListView.ListViewItemCollectionListView的零為基礎索引,若項目未與ListView控制項相關聯,則為 -1。

屬性

備註

你可以利用這個特性來判斷該項目是否與 ListView 控制項相關聯,以及判斷它在 ListView.ListViewItemCollectionListView中的位置。

適用於