选中,没有选择,不确定状态的检查。
<StackPanel Margin="10">
<CheckBox
Content="CheckBox"
HorizontalAlignment="Left"
Margin="10,10,0,0"
VerticalAlignment="Top"
IsThreeState="True"
Checked="CheckBox_Checked"
Unchecked="CheckBox_Unchecked"
Indeterminate="CheckBox_Indeterminate"/>
</StackPanel>
后台代码:
private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
this.Title = "Checked";
}
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
{
this.Title = "Unchecked";
}
private void CheckBox_Indeterminate(object sender, RoutedEventArgs e)
{
this.Title = "Indeterminate";
}
选中:
没有选中:
不确定状态:
网友评论