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