ListBoxItem.Selected Event

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Occurs when a ListBoxItem is selected.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

member Selected : IEvent<RoutedEventHandler,
    RoutedEventArgs>

To know when the selection in a ListBox changes, listen for the SelectionChanged event.

Identifier field

SelectedEvent

Routing strategy

Bubbling

Delegate

RoutedEventHandler

The following example shows how to subscribe to and handle this event.

<ListBoxItem Name="lbi0" Selected="OnSelected" Unselected="OnUnselected">Item 0</ListBoxItem>
No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show: