PropertyGrid -- controlling the Category Text Color

R

Rob Gurrieri

Is there a way to control the color of the text that appears in the Category
headings area of the property grid. I assume that it is tied to a system
color -- the text is hard to read with the "dark-gray" color that ends up
being the default under standard XP settings.

The "LineColor" property provides control of the background color of the
category heading -- but I don't see an obvious way to control the text
color.

Thanks,

Rob.
 
Y

Ying-Shen Yu[MSFT]

Hi Rob,

To my understanding, you would like to change the Text Color of the
PropertyGrid in your app, right?

The property "ViewForeColor" controls the Text in the PropertyGrid View,
however there seems no property to control the color of the category text
seperatly. You may also take a look at the "LineColor" and "ViewBackColor"
to make out your customized color schema.

Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
R

Rob Gurrieri

Thanks Ying-Shen Yu,

Seems that there is some "smart" logic internal to ViewForeColor that
ultimately determines the color of the "category" text (based on both
LineColor and ViewForeColor). With some further research, I discovered that
setting ViewForeColor "very close to black" works a little better than
"black".

if (propertyGrid1.ViewForeColor.ToArgb() == Color.Black.ToArgb())
propertyGrid1.ViewForeColor = Color.FromArgb(0, 0, 1);

Rob.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top