語言

ListView.CheckedIndexCollection.Contains(Int32) 方法

定義

判斷指定的索引是否位於集合中。

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

參數

checkedIndex
Int32

索引可在本收藏中找到。

傳回

true若 的指定索引ListView.ListViewItemCollectionListView為集合中的項目;否則, false。

備註

此 Contains 方法可判定 的 ListView.ListViewItemCollection 索引位置是否為存於 ListView.CheckedIndexCollection的檢查索引。 一旦你確定某項目在檢查過的索引集合中,你就可以用這個 IndexOf 方法來判斷該索引在 ListView.CheckedIndexCollection.

適用於

另請參閱