ListBox.GetSelectedIndices Method


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

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



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


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