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 项。

适用于

另请参阅