ToggleButton.Unchecked 事件

定義

ToggleButton 處於未核取狀態時發生。Occurs when a ToggleButton is unchecked.

public:
 event System::Windows::RoutedEventHandler ^ Unchecked;
public event System.Windows.RoutedEventHandler Unchecked;
member this.Unchecked : System.Windows.RoutedEventHandler 
Public Custom Event Unchecked As RoutedEventHandler 

事件類型

RoutedEventHandler

範例

下列範例會變更 Checked 和事件的訂閱 UncheckedEvent ,以變更的 FontStyle TextBlock textBlock1The following example changes subscribes to the Checked and UncheckedEvent events to change the FontStyle of the TextBlock, textBlock1.

<CheckBox Name="chkbox" Content="Italicize text"
          Checked="chkbox_Checked"
          Unchecked="chkbox_Unchecked"/>

<TextBlock Name="textBlock1" FontSize="14">
  The quick brown fox jumps over the lazy dog.
</TextBlock>
void chkbox_Unchecked(object sender, RoutedEventArgs e)
{
    textBlock1.FontStyle = FontStyles.Normal;
}

void chkbox_Checked(object sender, RoutedEventArgs e)
{
    textBlock1.FontStyle = FontStyles.Italic;
}
Private Sub chkbox_Unchecked(ByVal sender As Object, ByVal e As RoutedEventArgs)
    textBlock1.FontStyle = FontStyles.Normal
End Sub

Private Sub chkbox_Checked(ByVal sender As Object, ByVal e As RoutedEventArgs)
    textBlock1.FontStyle = FontStyles.Italic
End Sub

備註

路由事件資訊Routed Event Information

識別碼欄位Identifier field UncheckedEvent
路由策略Routing strategy 鼓 泡Bubbling
代理人Delegate RoutedEventHandler

適用於