WPF Change Background color of a Combobox

前端 未结 5 599
逝去的感伤
逝去的感伤 2020-11-27 06:31

In my WPF app I just want to change the background color of the Combo box. I don\'t mean the dropdown, I want is just whatever item is selected a background is set. Like se

5条回答
  •  清歌不尽
    2020-11-27 06:36

    Just add the following to your ComboBox style :)

    BasedOn="{StaticResource {x:Type ComboBox}}"
    

    Example:

    
    

    Believe me, it's probably the shortest way to do it... I don't see why we have to completely re-define the ComboBox template.

提交回复
热议问题