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

要放置在集合中的索引。

傳回

Boolean

如果 ListView.ListViewItemCollectionListView 中的指定索引為集合中的項目,則為 true,否則為 false

備註

方法 Contains 可讓您判斷 中的 ListView.ListViewItemCollection 索引位置是否為中 ListView.CheckedIndexCollection 儲存的其中一個檢查索引。 一旦您知道專案位於核取的索引集合中,您就可以使用 IndexOf 方法來判斷索引在 中 ListView.CheckedIndexCollection 的位置。

適用於

另請參閱