System.Windows.Forms.ListBox.SelectedIndices Property

Gets a collection that contains the zero-based indexes of all currently selected items in the System.Windows.Forms.ListBox.


public ListBox.SelectedIndexCollection SelectedIndices { get; }


Documentation for this section has not yet been entered.


For a multiple-selection System.Windows.Forms.ListBox, this property returns a collection containing the indexes to all items that are selected in the System.Windows.Forms.ListBox. For a single-selection System.Windows.Forms.ListBox, this property returns a collection containing a single element containing the index of the only selected item in the System.Windows.Forms.ListBox. For more information about how to manipulate the items of the collection, see System.Windows.Forms.ListBox.SelectedIndexCollection.

The System.Windows.Forms.ListBox class provides a number of ways to reference selected items. Instead of using the ListBox.SelectedIndices property to obtain the index position of the currently selected item in a single-selection System.Windows.Forms.ListBox, you can use the ListBox.SelectedIndex property. If you want to obtain the item that is currently selected in the System.Windows.Forms.ListBox, instead of the index position of the item, use the ListBox.SelectedItem property. In addition, you can use the ListBox.SelectedItems property if you want to obtain all the selected items in a multiple-selection System.Windows.Forms.ListBox.


Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0,