I am using a PropertyGrid to expose properties at runtime and I change the
line and background colors of the PropertyGrid to match the color theme of my
application. I would also like to change the color of category text (i.e.,
text that corresponds to the System.ComponentModel.Category attribute) since
the default color of gray is difficult to read on most backgrounds. It seems
that the category text is derived from the PropertyGrid.ViewForeColor
property, but I want to keep the PropertyGrid.ViewForeColor set to its
default value. In other words, I want to change the category text color
independent of PropertyGrid.ViewForeColor.
Is this possible?
Thanks,
Lance
"Jeffrey Tan[MSFT]" - 14 Mar 2005 08:02 GMT
Hi Lance,
Thanks for your feedback!!
Based on my understanding, you want to change the category text color with
the different color of the other fore ground text color in PropertyGrid.
PropertyGrid is a highly encapsulated control, and it did not expose any
extra property/method for controlling over the categroy color, it did not
offer the granularity on category text color. We can only use
PropertyGrid.ViewForeColor property to change all the foreground text color
at once.
For this issue, I think we may make some change over LineColor property,
then the category text color will be much readable with the LineColor
setting. Hope this helps.
==========================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
VisualHint - 31 Mar 2005 19:06 GMT
Dear Lance,
I would like to bring to your attention a product that I am
developping, called Smart PropertyGrid. It is a complete replacement
for the well known Microsoft PropertyGrid. However it is not a designer
to be used in VisualStudio ;)
When released, this control will act as the standard one, discovering
properties of an object instance at runtime, but it will also add many
many features. A part of these features can be read at
http://www.visualhint.com since this library already exists for MFC.
Basically what it adds is:
* Complete customization of the grid's look.
* Each property can have a different look and feel.
* Multiline properties.
* Multiple values per property.
* a lot more...
Your request of being able to set a specific color for a category or
property label is of course a basic feature of the library.
If you need more information, don't hesitate to contact me. A new web
site has been created explicitely for the library that is written in C#
at http://www.propertygrid.net .
Best regards
Nicolas Cadilhac
VisualHint