WPF(Trigger)
来源:互联网 发布:淘宝无限刷软件 编辑:程序博客网 时间:2024/06/07 01:39
<Window x:Class="TestResourcesTriggle.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <Style TargetType="CheckBox" > <Style.Triggers> <Trigger Property="IsChecked" Value="true" > <Trigger.Setters > <Setter Property="FontSize" Value="20" /> <Setter Property="Foreground" Value="Orange" /> </Trigger.Setters> </Trigger> </Style.Triggers> </Style> </Window.Resources> <StackPanel > <CheckBox Content="悄悄的我走了" Margin="5" /> <CheckBox Content="正如我悄悄的来" Margin="5,0" /> <CheckBox Content="我挥一挥衣袖" Margin="5" /> <CheckBox Content="不带走一片云彩" Margin="5,0" Width="496" /> </StackPanel> </Window>