語言

ListView.SelectedIndexCollection.Contains(Int32) 方法

定義

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

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

參數

selectedIndex
Int32

索引可在本收藏中找到。

傳回

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

備註

此 Contains 方法可讓您判斷 的 ListView.ListViewItemCollection 索引位置是否為儲存在 ListView.SelectedIndexCollection的選定索引之一。 一旦你知道某個項目在所選索引集合中,你就可以使用該 IndexOf 方法來判斷該索引在 ListView.SelectedIndexCollection.

適用於

另請參閱