語言

ComboBox.ObjectCollection.IndexOf(Object) 方法

定義

取得指定項目集合內的索引。

public:
 virtual int IndexOf(System::Object ^ value);
public int IndexOf(object value);
public int IndexOf(object? value);
abstract member IndexOf : obj -> int
override this.IndexOf : obj -> int
Public Function IndexOf (value As Object) As Integer

參數

value
Object

一個代表要在集合中找到的物品的物件。

傳回

項目位於集合中的零基索引;否則,為負1。

實作

例外狀況

參數 value 為 null。

備註

此 IndexOf 方法能讓你判斷物品在收藏中的位置。 在呼叫此方法前,要判斷項目是否位於集合中,請使用該 Contains 方法。

適用於

另請參閱