Rediger

Del via


ListBox.GetSelectedIndices Method

Definition

Gets the array of index values for currently selected items in the ListBox control.

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()

Returns

Int32[]

An array of integers, each representing the index of a selected item in the list box.

Remarks

Use the GetSelectedIndices method to identify or access the selected items in the ListBox control. Each element in the returned array represents the index for a selected list item. You can use the index values to access the items in the Items collection.

Applies to

See also