System.Windows.Forms.ListBox.SelectedIndexChanged Event

Occurs when the ListBox.SelectedIndex property or the ListBox.SelectedIndices collection has changed.

Syntax

public event EventHandler SelectedIndexChanged

Remarks

You can create an event handler for this event to determine when the selected index in the System.Windows.Forms.ListBox has been changed. This can be useful when you need to display information in other controls based on the current selection in the System.Windows.Forms.ListBox. You can use the event handler for this event to load the information in the other controls.

If the ListBox.SelectionMode property is set to SelectionMode.MultiSimple or SelectionMode.MultiExtended, any change to the ListBox.SelectedIndices collection, including removing an item from the selection, will raise this event.

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