ListBox.ObjectCollection.IndexOf(Object) メソッド
定義
指定した項目のコレクション内のインデックスを返します。Returns the index within the collection of the specified item.
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
コレクション内で検索する項目を表すオブジェクト。An object representing the item to locate in the collection.
戻り値
項目がコレクション内に存在する場合は、その項目の 0 から始まるインデックス。それ以外の場合は -1。The zero-based index where the item is located within the collection; otherwise, negative one (-1).
実装
例外
value
パラメーターが null です。The value
parameter is null.
注釈
IndexOfメソッドを使用すると、コレクション内の項目の位置を確認できます。The IndexOf method enables you to determine where an item is located within the collection. このメソッドを呼び出す前に、コレクション内に項目があるかどうかをContains確認するには、メソッドを使用します。To determine whether an item is located within the collection before calling this method, use the Contains method.