且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

设置ComboBox的背景颜色MouseOver在样式中突出显示的项目

更新时间:2022-06-22 07:57:31

如果你想要 Style 的 SolidColorBrush 应用于所有 ComboBox ,然后将其移动到 Style.Resources 部分:

If you want the SolidColorBrush to apply to all of the ComboBoxes affected by your Style, then just move it to your Style.Resources section:

<Style TargetType="ComboBox">
    <Style.Resources>
        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF745005"/>
    </Style.Resources>
    <Setter Property="Template">
        ...
    </Setter>
</Style>