Mysteries of a font in the PropertyGrid...

H

Herve Bocuse

I would like to know by what mechanism a font displayed in a
PropertyGrid, shows children (like Bold) that correspond to Properties
that only have a get, no set. Is there a special class in the framework
that gives the PropertyGrid the list of rows to display for the font,
and when a new value is entered by the user, the way to modify the
underlying font (since a bold attribute is assigned to the font inside
a FontStyle) ?

Thank you for your help.

Herve
 
S

Sean Hederman

Herve Bocuse said:
I would like to know by what mechanism a font displayed in a
PropertyGrid, shows children (like Bold) that correspond to Properties
that only have a get, no set. Is there a special class in the framework
that gives the PropertyGrid the list of rows to display for the font,
and when a new value is entered by the user, the way to modify the
underlying font (since a bold attribute is assigned to the font inside
a FontStyle) ?

Yes, It's called FontConverter, it's a subclass of TypeConverter, which
offers quite a few ways of customising the display of properties in the
PropertyGrid. You use TypeConverterAttribute to associate a TypeConverter
with a type or property.
 

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