System.Windows.Forms.ListView.SelectedIndexChanged Event

Occurs when the ListView.SelectedIndices collection changes.

Syntax

public event EventHandler SelectedIndexChanged

Remarks

The ListView.SelectedIndices collection changes whenever the ListViewItem.Selected property of a System.Windows.Forms.ListViewItem changes. The property change can occur programmatically or when the user selects an item or clears the selection of an item. When the user selects an item without pressing CTRL to perform a multiple selection, the control first clears the previous selection. In this case, this event occurs one time for each item that was previously selected and one time for the newly selected item.

To determine which items are selected in the System.Windows.Forms.ListView control, use the ListView.SelectedItems property to access the System.Windows.Forms.ListView.SelectedListViewItemCollection. You can create an event handler for this event to perform tasks whenever there is a change to the selected items in the System.Windows.Forms.ListView control.

For more information about handling events, see Consuming Events.

Requirements

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