<Window x:Class="WpfApp04.TestWin01"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp04"
mc:Ignorable="d"
Title="TestWin01" Height="450" Width="800">
<Window.Resources>
<Style TargetType="CheckBox">
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="FontSize" Value="20"/>
<Setter Property="Foreground" Value="Orange"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<StackPanel>
<CheckBox Content="chk1" IsChecked="True"/>
<CheckBox Content="chk2" IsChecked="False"/>
<CheckBox Content="chk3" IsChecked="True"/>
<CheckBox Content="chk4" IsChecked="False"/>
</StackPanel>
</Grid>
</Window>
wpf Style里面的Trigger
最新推荐文章于 2024-08-21 07:15:00 发布