C
Claus Christiansen
Hi,
I'm creating a control inherited from System.Windows.Forms.Control and I
want to add a public float[] property that should be visible in the
PropertyGrid.
Having read "Building Windows Forms Controls and Components with Rich
Design-Time Features" part 1 & 2 on MSDN I thought this would be a breeze
(and with simple properties like in the articles it is). However, the
float[] property leaves me baffled.
I've made a FloatArrayConverter inherited from TypeConverter and
decorated the property with:
[DefaultValue(null),
TypeConverter(typeof(FloatArrayConverter)),
DesignerSerializationVisibilityAttribut
(DesignerSerializationVisibility.Content),
Description("Array of values")]
But entering values into the Single Collection Editor that pops up are
not persisted or even converted.
I guess I can make a workaround by creating my own UITypeEditor but it
seems that I'm 'almost there'.
I've tried letting the TypeConverter inherit from ArrayConverter and
ExpandableObjectConverter with no luck.
Any ideas?
Regards
/Claus
I'm creating a control inherited from System.Windows.Forms.Control and I
want to add a public float[] property that should be visible in the
PropertyGrid.
Having read "Building Windows Forms Controls and Components with Rich
Design-Time Features" part 1 & 2 on MSDN I thought this would be a breeze
(and with simple properties like in the articles it is). However, the
float[] property leaves me baffled.
I've made a FloatArrayConverter inherited from TypeConverter and
decorated the property with:
[DefaultValue(null),
TypeConverter(typeof(FloatArrayConverter)),
DesignerSerializationVisibilityAttribut
(DesignerSerializationVisibility.Content),
Description("Array of values")]
But entering values into the Single Collection Editor that pops up are
not persisted or even converted.
I guess I can make a workaround by creating my own UITypeEditor but it
seems that I'm 'almost there'.
I've tried letting the TypeConverter inherit from ArrayConverter and
ExpandableObjectConverter with no luck.
Any ideas?
Regards
/Claus