TableCellCollection.IList.IndexOf(Object) 方法

定义

搜索指定的对象,并返回集合中第一个匹配项的从零开始的索引。Searches for the specified object and returns the zero-based index of the first occurrence within the collection.

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

参数

o
Object

要在集合中定位的对象。The object to locate within the collection.

返回

Int32

对象的第一个匹配项在集合中的从零开始的索引;否则,如果对象不在集合中,则为 -1。The zero-based index of the first occurrence of the object within the collection; otherwise, -1 if the object is not in the collection.

实现

注解

通常,应使用 GetCellIndex 方法获取对象中元素的索引 TableCellCollectionTypically, you should use the GetCellIndex method to get the index of an element in a TableCellCollection object.

IList.IndexOf方法是显式接口成员实现。The IList.IndexOf method is an explicit interface member implementation. 它只能在 TableCellCollection 实例被强制转换为 IList 接口时使用。It can be used only when the TableCellCollection instance is cast to an IList interface.

适用于

另请参阅