ListView.CheckedIndexCollection.IndexOf(Int32) 方法

定義

從清單檢視控制項的 ListView.CheckedIndexCollection 傳回在指定索引之 ListView.ListViewItemCollection 中的索引。

public:
 int IndexOf(int checkedIndex);
public int IndexOf (int checkedIndex);
member this.IndexOf : int -> int
Public Function IndexOf (checkedIndex As Integer) As Integer

參數

checkedIndex
Int32

要放置在集合中之 ListView.ListViewItemCollection 以零起始的索引。

傳回

如果 ListView.ListViewItemCollection 的指定索引位於 ListView.CheckedIndexCollection 中,則為集合中以零起始的索引,但如果索引不在集合中,則為 -1。

備註

一旦您知道專案位於已核取的索引集合中, (使用 Contains 方法) ,您就可以使用 IndexOf 方法來判斷索引 ListView.CheckedIndexCollection 在 中的位置。

適用於

另請參閱