Share via


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 アクセスできます。

適用対象

こちらもご覧ください