ComboBox.ObjectCollection.IndexOf(Object) 方法

定義

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

public:
 virtual int IndexOf(System::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

表示位於集合中項目的物件。

傳回

Int32

以零起始的索引,是集合內項目的位置,否則為 -1。

實作

例外狀況

value 參數為 null

備註

方法 IndexOf 可讓您判斷專案位於集合內的位置。 若要在呼叫這個方法之前判斷專案是否位於集合內,請使用 Contains 方法。

適用於

另請參閱