ListView.SelectedIndexCollection.IndexOf(Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
public:
int IndexOf(int selectedIndex);
public int IndexOf(int selectedIndex);
member this.IndexOf : int -> int
Public Function IndexOf (selectedIndex As Integer) As Integer
參數
- selectedIndex
- Int32
從 ListView.ListViewItemCollection 到 在集合中尋找的以零為基礎的索引。
傳回
集合中指定的索引ListView.ListViewItemCollectionListView.SelectedIndexCollection位於集合中,若索引位於集合中,則為 -1 索引。
備註
一旦你確定某個項目在所選索引集合中(使用該 Contains 方法),你就可以用該 IndexOf 方法來判斷該索引在 ListView.SelectedIndexCollection中的位置。