共用方式為


Selector.Unselected 附加事件

定義

當項目取消選取時發生。

see AddUnselectedHandler, and RemoveUnselectedHandler
see AddUnselectedHandler, and RemoveUnselectedHandler
see AddUnselectedHandler, and RemoveUnselectedHandler

範例

下列範例示範如何搭配 ListBox 控制項使用 Unselected 事件,以及如何建立事件處理常式。

<ListBoxItem Name="lbi0" Selected="OnSelected" Unselected="OnUnselected">
     Item 0</ListBoxItem>
private void OnUnselected(object sender, RoutedEventArgs e)
{
    Item.Content = ((ListBoxItem)sender).Name + " was unselected.";
}
Private Sub OnUnselected(ByVal sender As Object, ByVal e As RoutedEventArgs)
    Item.Content = (CType(sender, ListBoxItem)).Name & " was unselected."
End Sub

備註

路由事件資訊

識別碼欄位 UnselectedEvent
路由策略 鼓 泡
代理人 RoutedEventHandler

適用於