ListBox.IntegerCollection.IndexOf(Int32) 方法

定義

擷取 ListBox.IntegerCollection 中指定整數的索引。

public:
 int IndexOf(int item);
public int IndexOf (int item);
member this.IndexOf : int -> int
Public Function IndexOf (item As Integer) As Integer

參數

item
Int32

要擷取其索引的整數。

傳回

Int32

ListBox.IntegerCollection 中整數之以零起始的索引,否則為 -1。

備註

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

適用於