Is there any way to check the box? iv tried to define a style for the checkbox, but that didn't work.
after using mole, it seems that the checkbox control has no ToggleButton, instead it uses BulleDecorator, im not sure about it the first time im using mole.
What I want to achieve is that instead of a checkbox, I want a red or green circle.
<Style TargetType="{x:Type CheckBox}">
<Setter Property="IsHitTestVisible" Value="False"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border x:Name="innerBorder">
<Ellipse Fill="#FFFF0000" Stroke="#FF000000" Stretch="Fill" x:Name="statusLight" Width="15" Height="15" Margin="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="statusLight" Property="Fill" Value="#FF00FF00" />
</Trigger>
<Trigger Property="IsChecked" Value="False">
<Setter TargetName="statusLight" Property="Fill" Value="#FFFF0000" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
source
share