MenuItem.Checked MenuItem.Checked MenuItem.Checked MenuItem.Checked Event

定義

メニュー項目がオンにされたときに発生します。Occurs when a menu item is checked.

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

次の例は、イベントCheckedの処理を示しています。The following example demonstrates handling the Checked event.

<MenuItem Header="_Bold" IsCheckable="True"
          Checked="Bold_Checked"
          Unchecked="Bold_Unchecked"/>
private void Bold_Checked(object sender, RoutedEventArgs e)
{
    textBox1.FontWeight = FontWeights.Bold;
}

private void Bold_Unchecked(object sender, RoutedEventArgs e)
{
    textBox1.FontWeight = FontWeights.Normal;
}
Private Sub Bold_Checked(ByVal sender As Object, ByVal e As RoutedEventArgs)
    textBox1.FontWeight = FontWeights.Bold
End Sub

Private Sub Bold_Unchecked(ByVal sender As Object, ByVal e As RoutedEventArgs)
    textBox1.FontWeight = FontWeights.Normal
End Sub

注釈

ルーティングされたイベント情報Routed Event Information

識別子フィールドIdentifier field CheckedEvent
ルーティング方法Routing strategy バブリングBubbling
DelegateDelegate RoutedEventHandler

適用対象