ListBox.GetSelectedIndices 方法

定義

取得 ListBox 控制項中目前已選取項目之索引值的陣列。

public:
 virtual cli::array <int> ^ GetSelectedIndices();
public virtual int[] GetSelectedIndices ();
abstract member GetSelectedIndices : unit -> int[]
override this.GetSelectedIndices : unit -> int[]
Public Overridable Function GetSelectedIndices () As Integer()

傳回

Int32[]

整數陣列,每個整數都代表清單方塊中已選取項目的索引。

備註

GetSelectedIndices使用 方法來識別或存取 控制項中 ListBox 選取的專案。 傳回陣列中的每個專案都代表所選清單專案的索引。 您可以使用索引值來存取集合中的 Items 專案。

適用於

另請參閱