ListBox.GetSelectedIndices 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得控制項中目前選取項目 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 項目。