我们如何在Xceed的CheckListbox控件中更改复选框的刻度颜色。 我已经尝试过这段代码
<Style.Triggers>
<Trigger Property="IsSelected" Value="False">
<Setter Property="Background" Value="Transparent"></Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Background" Value="Transparent"></Setter>
</Trigger>
<Trigger Property="IsKeyboardFocusWithin" Value="False">
<Setter Property="Background" Value="Transparent"></Setter>
</Trigger>
</Style.Triggers>
答案 0 :(得分:0)
CheckListBox
是CheckBox
元素的集合,您可以照常设置样式。这应该有效:
<xctk:CheckListBox x:Name="_listBox" ...>
<xctk:CheckListBox.Resources>
<Style TargetType="CheckBox">
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="Red"></Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Green"></Setter>
</Trigger>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="Background" Value="Blue"></Setter>
</Trigger>
</Style.Triggers>
<Setter Property="Background" Value="Yellow" />
</Style>
</xctk:CheckListBox.Resources>
</xctk:CheckListBox>