[SOLVED] WPF Combobox background color
-
Hello, I know this is a silly question but i am stunned by this. Among controls that I use like DecimalUpDown (From WPF toolkit), textboxes and comboboxes. For all controls that are required to be filled, I have set the background color to LightYellow. I am not so successful, because i am failing to applay to combobox. No matter what background property is, Combo box ignores/overrides it. I do not wan't to change any apperances of any ComboBoxItems. Also Since i need it on Windows XP, my Framework target is 4.0 Any help is appreciated.
-
Hello, I know this is a silly question but i am stunned by this. Among controls that I use like DecimalUpDown (From WPF toolkit), textboxes and comboboxes. For all controls that are required to be filled, I have set the background color to LightYellow. I am not so successful, because i am failing to applay to combobox. No matter what background property is, Combo box ignores/overrides it. I do not wan't to change any apperances of any ComboBoxItems. Also Since i need it on Windows XP, my Framework target is 4.0 Any help is appreciated.
-
Hello, I know this is a silly question but i am stunned by this. Among controls that I use like DecimalUpDown (From WPF toolkit), textboxes and comboboxes. For all controls that are required to be filled, I have set the background color to LightYellow. I am not so successful, because i am failing to applay to combobox. No matter what background property is, Combo box ignores/overrides it. I do not wan't to change any apperances of any ComboBoxItems. Also Since i need it on Windows XP, my Framework target is 4.0 Any help is appreciated.
Check if someone has already reported this issue on codeplex. Could be an issue. You could first try setting the back color via the view model though.
Apps - Color Analyzer | Arctic | XKCD | Sound Meter | Speed Dial
-
On google all i could find how to change drop down box when i click on combo box. Same goes for that link on CP. And i do not need that. I wanted a backgroud color changed directly on combobox and not on the drop down list. Upon further investigation by WPF inspecotrs I found that there is a specific background property on the child visual tree
ComboBox
Grid(templateRoot)
Popup (PART_Popup)
ToggleButton (toggleButton)
Border (templateRoot)
Border (splitBorder)
Path (Arrow)
ContentPresenter (contentPresenter)
TextBlockI Have to change templateRoot background property. But i do not know how. I am noob at WPF
-
Check if someone has already reported this issue on codeplex. Could be an issue. You could first try setting the back color via the view model though.
Apps - Color Analyzer | Arctic | XKCD | Sound Meter | Speed Dial
Not an issue. I also found out what to change with WPF inspector. But i do not know how. I replied to Mycroft Holmes with detail on what to change.
-
On google all i could find how to change drop down box when i click on combo box. Same goes for that link on CP. And i do not need that. I wanted a backgroud color changed directly on combobox and not on the drop down list. Upon further investigation by WPF inspecotrs I found that there is a specific background property on the child visual tree
ComboBox
Grid(templateRoot)
Popup (PART_Popup)
ToggleButton (toggleButton)
Border (templateRoot)
Border (splitBorder)
Path (Arrow)
ContentPresenter (contentPresenter)
TextBlockI Have to change templateRoot background property. But i do not know how. I am noob at WPF
Now you are beyond where I have ventured, especially as I work in Silverlight but I believe you need to completely restyle the combo to get what you want. Some use Expression Blend that will allow you to grab the controls style and fiddle with it, not something I would contemplate doing. I'm a great believer in battleshit grey and would never get hung up about the colour of an objects styling.
Never underestimate the power of human stupidity RAH
-
Now you are beyond where I have ventured, especially as I work in Silverlight but I believe you need to completely restyle the combo to get what you want. Some use Expression Blend that will allow you to grab the controls style and fiddle with it, not something I would contemplate doing. I'm a great believer in battleshit grey and would never get hung up about the colour of an objects styling.
Never underestimate the power of human stupidity RAH
I was searching for a tool that is capable extracting Styles/Theme. I know it exsist, because i had it a few years ago. I tried VS2012 And Blend. What i noticed is that when using create a copy of style is not a perfect. I am using it on Windows 8 and border has sharp edges, and when applying a copy of a style, my controls border get rounded. On top of all when i creadet a copy, my background property took an effect i wanted it to do in the first place, without modifiying style??? I was realy suprised by this. I got it working. Thanks for sugestion.
-
Not an issue. I also found out what to change with WPF inspector. But i do not know how. I replied to Mycroft Holmes with detail on what to change.
I have been able to locate styles for a number of controls on msdn. You can give it a try next time onwards. The toolkit is opensource, so you could get the styles directly via code.
Apps - Color Analyzer | Arctic | XKCD | Sound Meter | Speed Dial