ListBox.SelectedIndexCollection.IList.IndexOf(Object) 方法

定義

如需這個成員的說明,請參閱 IndexOf(Object)

 virtual int System.Collections.IList.IndexOf(System::Object ^ selectedIndex) = System::Collections::IList::IndexOf;
int IList.IndexOf (object selectedIndex);
int IList.IndexOf (object? selectedIndex);
abstract member System.Collections.IList.IndexOf : obj -> int
override this.System.Collections.IList.IndexOf : obj -> int
Function IndexOf (selectedIndex As Object) As Integer Implements IList.IndexOf

參數

selectedIndex
Object

要放置在這個集合中的 ListBox.ObjectCollection 以零起始的索引。

傳回

如果 ListBox.ObjectCollection 的指定索引位於 ListBox.SelectedIndexCollection 中,則為集合中以零起始的索引,否則為 -1。

實作

備註

這個成員是明確介面成員實作, 只有在 ListBox.SelectedIndexCollection 執行個體轉換成 IList 介面時,才能使用這個成員。

ListBox.SelectedIndexCollection 包含 ListBox.ObjectCollection 控制項的 ListBox 中已選取項目之索引。

適用於

另請參閱