Partager via


MenuItem.Checked Événement

Définition

Se produit lorsqu'un élément de menu est activé.

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

Type d'événement

Exemples

L’exemple suivant illustre la gestion de l’événement Checked .

<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

Remarques

Informations sur les événements acheminés

Champ Identificateur CheckedEvent
Stratégie de routage Bouillonnant
Délégué RoutedEventHandler

S’applique à