This project is read-only.

Found My Error in Coloring PropertGrid

Feb 19, 2012 at 1:14 PM
Edited Feb 25, 2012 at 4:41 PM

I originally posted this issue to David who was kind enough to respond but who had no solution--I finally found a way to change the background color of the PropertyGrid and it is posted as my response to David's response to my original question about this bug below.

I assumed that the PropertyGrid had a parent that also need to be colored BUT it was my own fault because I was loading the library from an older copy of the DLL without my changes in the constructor of the PropertyGrid.  Usually I add the DLL of the library from the directory where it is created to..

Please accept my apology!

Original question:

Hi, First, you are a genius! Incredible piece of work... Congratulations!

I was trying to change the default color of the PropertyGrid.
It seemns that the PropertyGrid in your latest SilverlightClient code has a background and a border that are both Yellow.

I was able to change the default color of the background of the PropertyGrid from Yellow to Gray BUT the border of the PropertyGrid still remains Yellow no matter what changes I make--I changed all the "yellow" colors to "gray" but the border of the PropertyGrid is still Yellow!

Could you please tell me how to change both the background AND the BORDER of the PropertyGrid to Gary so that the entire PropertyGrid is Gray?

How to change the background color of the Status message to gray?

Thank you!

Feb 23, 2012 at 1:20 AM

Not sure why this is not working for you.  You are making changes in DrawingHost.CreatePropertyGrid() right? I believe the border is black not yellow. You would change it to gray by changing the BorderBrush.  For the status message make similar changes to DrawingHost.CreateStatusBar().

Feb 24, 2012 at 9:16 PM
Edited Feb 25, 2012 at 4:45 PM

Hi, Thank you for responding.... I FOUND my mistake in painting the background of your PropertyGrid.   

I originally posted this issue to David who was kind enough to respond but who had no solution--I finally found a way to change the background color of the PropertyGrid and it is posted as my response to David's response to my original question about this bug below.

I assumed that the PropertyGrid had a parent that also need to be colored BUT it was my own fault because I was loading the library from an older copy of the DLL without my changes in the constructor of the PropertyGrid.  Usually I add the DLL of the library from the directory where it is created to..

Please accept my apology!

// FIX ---> This is how to change background color of PropertyGrid !!!   

drawingHost.PropertyGrid.Margin = new Thickness(0);   
drawingHost.PropertyGrid.Background = new SolidColorBrush(Color.FromArgb(200, 213, 220, 232));    drawingHost.PropertyGrid.Parent.SetValue(BackgroundProperty,
               new SolidColorBrush(Color.FromArgb(200, 213, 220, 232)));

This "solution" I found was actually working on the OLDER copy of the library where the DLL had it set to yellow in the constructor of the PropertyGrid !

It was my fault. But this mistake does point out the need to make sure you are loading the NEW version of the library  in VisualStudio.