Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hello

I have a quick question. I was wondering is it possible to use a combo box in a WPF form that can be used to change the colour of the grid backgrounds that I have. So for example, if I selected "Yellow" off the combo box list, the grids within the form will change colours to yellow. I just need a code snippet because I can then use blend to figure out the different colours I would like to use.

Thank you
Posted
Comments
Shahin Khorshidnia 23-Mar-12 10:33am    
Yes
Sergey Alexandrovich Kryukov 23-Mar-12 12:01pm    
Yes
--SA

1 solution

Use System.Drawing.KnownColor. In the SelectedItemChange/SlectionChange event set the color of the grid to the selected value.
 
Share this answer
 
Comments
MartynL2011 31-Mar-12 11:33am    
Could you possibly show an example?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900