On a WPF ComboBox, is it possible to set a different Foreground color for the textbox and the popup?

StackOverflow https://stackoverflow.com/questions/134825

  •  02-07-2019
  •  | 
  •  

Question

Basically my problem stems from a desire to have the textbox portion be white, and the drop down to be black. When I set the text to white, the drop down appears as I want it, but the text in the textbox itself is hardly readable. Setting the Foreground to black makes the drop down unreadable.

Is there a good way to handle this? I am still learning WPF.

Was it helpful?

Solution

Edit the ControlTemplate, You will see a TextBlock and another PopUp which again has a set of controls. Have a different ForeGround/Background for this TextBox,

OTHER TIPS

Your best bet is to edit a copy of the template of the ComboBox and set the two of them independently.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top