CheckedListBox.CheckedIndexCollection.IndexOf(Int32) 方法

定義

傳回已選取索引集合內的索引。Returns an index into the collection of checked indexes.

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

參數

index
Int32

已選取項目的索引。The index of the checked item.

傳回

索引,其指定已選取項目的索引;如果 index 參數不在已選取的索引集合中,則為 –1。The index that specifies the index of the checked item or -1 if the index parameter is not in the checked indexes collection. 如需詳細資訊,請參閱 CheckedListBox.CheckedIndexCollection 類別概觀中的範例。For more information, see the examples in the CheckedListBox.CheckedIndexCollection class overview.

備註

index 參數是 items 集合中已核取專案的索引。The index parameter is the index of a checked item in the items collection. 傳回值是已檢查索引集合的對應索引。The return value is the corresponding index into the checked indexes collection.

適用於

另請參閱