0

我们如何更改 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> 
4

1 回答 1

0

ACheckListBoxCheckBox您可以照常设置样式的元素集合。这应该有效:

<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>
于 2018-04-09T14:04:16.173 回答