語言

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.ListViewItemCollectionListView.CheckedIndexCollection位於集合中;否則,若索引不在集合中,則 -1。

備註

一旦你確定某項目在檢查索引集合中(使用該 Contains 方法),你就可以用該 IndexOf 方法來判斷該索引在 ListView.CheckedIndexCollection中的位置。

適用於

另請參閱