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 中的选定项的索引。

适用于

另请参阅