MenuItem.Checked 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在选中菜单项时发生。
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 事件。
<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
注解
路由事件信息
标识符字段 | CheckedEvent |
路由策略 | 鼓 泡 |
委托 | RoutedEventHandler |