WPF ComboBox:禁用时的背景颜色 [英] WPF ComboBox: background color when disabled
本文介绍了WPF ComboBox:禁用时的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前在WPF中为我的ComboBox使用此样式:
I currently use this style for my ComboBox in WPF:
<Style TargetType="ComboBox">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="#303030"/>
<Setter Property="BorderBrush" Value="#000000"/>
</Style>
如何在禁用ComboBox时如何更改它以指定背景颜色?
How can I change it to specify the background color when the ComboBox is disabled?
(这是此问题的后续: WPF组合框颜色< a>)
(this is a follow-up to this question: WPF combobox colors)
推荐答案
我最终使用这里使用的样式作为基础,这允许设置背景颜色已停用:
I ended up using the style used here as a base, and this did allow to set the background color when disabled:
http://msdn.microsoft.com/en-us/library/ms752094%28v=VS.85%29.aspx
这篇关于WPF ComboBox:禁用时的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文