Problem using SizeF / PointF etc. in PropertyGrid

  • Thread starter Thread starter Flare
  • Start date Start date
F

Flare

I have build up a nice Graphical Structure. All these have there placement
and size defined with xxxF structures because I have to use units lile
millimeters. My plan was to use the PropertyGrid wich fitted nicly to edit
the Graphics objects. But to my big suprise the attribut shows up as
readonly even though i have defined it like
[Browsable(true), ReadOnly(false),DesignOnly(false)]

Is it a bug or some limitation in the framwork? Is PRETTY critical if there
is no workaround. I suppose i could make my oen structure like MyPointF and
etc, but i would be a nightmare to cast up and down when passing this
structure to the GDI methods wich usaly takes PointF.

Any suggestions / solutions.?

Reagards
Anders
 
I don't think there's a default typeconverter for those types. Try creating
a typeconverter for those classes that can convert to/from string
(particularly from a string) and add a typeconverter attribute for your
property that specifies to use your typeconverter. If you want it to be
expandable like a point, you'll need to override the createinstance and
getproperties related members.
 
Back
Top