ListBoxItem.Unselected Event
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.
Occurs when a ListBoxItem is unselected.
public:
event System::Windows::RoutedEventHandler ^ Unselected;
public event System.Windows.RoutedEventHandler Unselected;
member this.Unselected : System.Windows.RoutedEventHandler
Public Custom Event Unselected As RoutedEventHandler
Event Type
Examples
The following examples show how to subscribe to and handle this event.
<ListBoxItem Name="lbi0" Selected="OnSelected" Unselected="OnUnselected">Item 0</ListBoxItem>
private void OnUnselected(object sender, RoutedEventArgs e)
{
ListBoxItem lbi = e.Source as ListBoxItem;
if (lbi != null)
{
label1.Content = lbi.Content.ToString() + " is unselected.";
}
}
Private Sub OnUnselected(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim lbi As ListBoxItem = TryCast(e.Source, ListBoxItem)
If lbi IsNot Nothing Then
label1.Content = lbi.Content.ToString() & " is unselected."
End If
End Sub
Remarks
To know when the selection in a ListBox changes, listen for the SelectionChanged event.
Routed Event Information
Identifier field | UnselectedEvent |
Routing strategy | Bubbling |
Delegate | RoutedEventHandler |
Applies to
GitHub पर हमारे साथ सहयोग करें
इस सामग्री का स्रोत GitHub पर पाया जा सकता है, जहाँ आप समस्याएँ बना और समीक्षा भी कर सकते हैं और अनुरोध खींच सकते हैं. अधिक जानकारी के लिए, हमारे योगदानकर्ता गाइड देखें.