I want to change color of combo box for diasbled state to more darker one. Please let me know how do achieve this using triggers or any other way. Thanks !!
Asked
Active
Viewed 2,964 times
1
-
There is the answer you are looking for:) [stackoverflow thread][1] [1]: http://stackoverflow.com/questions/2388833/wpf-combobox-background-color-when-disabled – Steven Jul 18 '13 at 12:48
-
All controls look alike when they are disabled.How can you set color to it. – Vishal Jul 18 '13 at 13:12
2 Answers
1
Change the color in a simple property trigger:
<Style TargetType="ComboBox">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="Green"/>
</Trigger>
</Style.Triggers>
</Style>

Lennart
- 9,657
- 16
- 68
- 84

Barracoder
- 3,696
- 2
- 28
- 31
-
combobox corners changed to rounded one after applying above trigger.. HOw to change shape of combox to flat one? – prawin Jul 18 '13 at 14:32
-
1Background or foreground color? Question asks for foreground, answer uses background. This indeed wouldn't work for changing foreground. – Jun 04 '16 at 09:12
1
Try this:-
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
In my case I set DyanmicResource to SystemColors.GrayTextBrushKey
You can set according to your requirement Check this link out

Vishal
- 604
- 1
- 12
- 25