0

How can we change the tick color of checkbox in Xceed's CheckListbox control. I have already tried this code

<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> 
Shweta Goyal
  • 94
  • 1
  • 9
  • It's probably because there's something inside the template for this control on top of the background. Extract the template and take a look. You do that by selecting an instance of such a control and clicking the box to the right of template in properties > Miscellaneous. – Andy Apr 09 '18 at 10:13

1 Answers1

0

A CheckListBox is a collection of CheckBox elements that you can style as usual. This should work:

<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>
mm8
  • 163,881
  • 10
  • 57
  • 88