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

定义

有关此成员的说明,请参见 IndexOf(Object)For a description of this member, see IndexOf(Object).

 virtual int System.Collections.IList.IndexOf(System::Object ^ selectedIndex) = System::Collections::IList::IndexOf;
int IList.IndexOf (object selectedIndex);
Function IndexOf (selectedIndex As Object) As Integer Implements IList.IndexOf

参数

selectedIndex
Object

要在此集合中查找的来自 ListBox.ObjectCollection 的从零开始的索引。The zero-based index from the ListBox.ObjectCollection to locate in this collection.

返回

如果从零开始的索引位于 ListBox.ObjectCollection 中,则为 ListBox.SelectedIndexCollection 的指定索引所在的集合中的从零开始的索引;否则为 -1。The zero-based index in the collection where the specified index of the ListBox.ObjectCollection is located if it is in the ListBox.SelectedIndexCollection; otherwise, -1.

实现

注解

此成员是显式接口成员的实现。This member is an explicit interface member implementation. 它只能在 ListBox.SelectedIndexCollection 实例被强制转换为 IList 接口时使用。It can be used only when the ListBox.SelectedIndexCollection instance is cast to an IList interface.

ListBox.SelectedIndexCollection 包含 ListBox.ObjectCollection 控件的 ListBox 中的选定项的索引。The ListBox.SelectedIndexCollection contains the indexes of selected items in the ListBox.ObjectCollection of the ListBox control.

适用于

另请参阅