views:

454

answers:

1

This seems like it's far more difficult than it should be, but I'd like to set the background color of a dropdown combobox programmatically (ie. if the user selects one value, I'd like it to appear red, otherwise blue...)

What I've noticed is that if you just set the Background property to a SolidColorBrush, the only thing that seems to change is that slight-glow that the ComboBox has.

I know that the ComboBox is constructed of multiple objects, and that it takes more than just setting the BackgroundColor, but I'm just wondering if there's a simple way of doing this programatically, where the entire background changes colors, instead of the glow.

+2  A: 

Unfortunately most of the colors involved are hardcoded into the combox style. Hence the only way you are going to achieve greater control over the color used is to copy out the entire ComboBox style and simplify the set of Rectangle elements named Background.....

AnthonyWJones