ComboBox.ObjectCollection.IndexOf(Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得指定項目集合內的索引。
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 方法。