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.ListViewItemCollection 控制項的 ListView 中,項目之以零起始的索引,但如果項目與 ListView 控制項無關,則為 -1。

屬性

備註

您可以使用這個屬性來判斷專案是否與控制項相關聯 ListView ,以及判斷其位置在 的 ListViewListView.ListViewItemCollection

適用於