Hello!
I'm using Visual Studio 2005 Professional Edition, especially Visual Basic.
What I'm trying to do is to make a UserControl using "Windows Control
Library" project.
I'm adding some properties in the class, but I found out that when I add a
property of type "PointF", I cannot seem to change the value in designer. It
looks like as if it is read-only when it's not. Strange thing is, when the
property is "Point" type, then it's ok. Is there any work-around of this
problem or am I misunderstanding something?
Andrew L - 22 Feb 2008 20:20 GMT
Hi,
Most likely, this problem appears because the PointF struct doesn't have
TypeConverter attrubute (the Point class uses PointConverter). Most likely
you may write you're own TypeConverter (descendant from the PointConverter
or TypeConverter) and add attribute to your property.
PointF pf;
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
EditorBrowsable(EditorBrowsableState.Advanced),
TypeConverter(typeof(PointConverter))]
public PointF Pf {
get { return pf; }
set { pf = value; }
}
Thanks,
Andrew
> Hello!
> I'm using Visual Studio 2005 Professional Edition, especially Visual
[quoted text clipped - 7 lines]
> property is "Point" type, then it's ok. Is there any work-around of this
> problem or am I misunderstanding something?