如何在wpf中更改组合框下拉按钮的颜色 [英] how to change the color of drop down button of combo box in wpf

查看:74
本文介绍了如何在wpf中更改组合框下拉按钮的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在wpf中更改组合框下拉按钮的颜色?组合框在windowxp中出现蓝色默认值。请帮我。

how to change the color of drop down button of combo box in wpf?the combo box is appearing blue color default in windowxp. please do the needful to me .

推荐答案

<Style TargetType="{x:Type ComboBoxItem}">
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                        <GradientStop Color="#FF3A60AD" Offset="0.528"/>
                        <GradientStop Color="#FF6A85D8" Offset="0.01"/>
                        <GradientStop Color="#FF3464C4" Offset="1"/>
                        <GradientStop Color="#FF202E7E" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
        </Style>





你可以添加一个样式来定位所有comboBox Ite m,这是我的例子中给出的。或者,您可以通过修改每个项目的各个属性来单独刷每个项目。



You can add a style to target All comboBox Item, which is what is given in my example. Alternatively, you can individually brush each item by modifying each items individual properties.


这篇关于如何在wpf中更改组合框下拉按钮的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆