MenuItem.Checked 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 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
Event Type
Examples
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
Remarks
Routed Event Information
Identifier field | CheckedEvent |
Routing strategy | Bubbling |
Delegate | RoutedEventHandler |
Applies to
Surađujte s nama na GitHubu
Izvor za ovaj sadržaj možete pronaći na GitHubu, gdje možete stvarati i pregledavati probleme i zahtjeve za povlačenjem. Dodatne informacije potražite u našem vodiču za suradnike.