ListBox.GetSelectedIndices Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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.