G
Guest
I added my own property (a double) to a derived component which can be edited
in the property browser and is serializable. When I enter a small number such
as .00001, the code generated in InitializeComponent() looks like this:
this.StartTime.Increment = 1E-05;
This compiles and runs fine, but the forms designer barfs and won't open the
form. If I change the initialization to this:
this.StartTime.Increment = 1.0E-05;
then the form is happy. The form designer doesn't seem to understand and
exponent without a decimal point.
Any ideas? Here's what I'm using to get/set the value.
protected double increment = 1.0E-6;;
....
[Category("Misc"),
Description("Gets or sets the numeric control increment value."),
DefaultValueAttribute(1.0E-6),
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
TypeConverterAttribute(typeof(DoubleConverter))]
override public object Increment
{
get { return increment; }
set { increment = Convert.ToDouble(value); }
}
in the property browser and is serializable. When I enter a small number such
as .00001, the code generated in InitializeComponent() looks like this:
this.StartTime.Increment = 1E-05;
This compiles and runs fine, but the forms designer barfs and won't open the
form. If I change the initialization to this:
this.StartTime.Increment = 1.0E-05;
then the form is happy. The form designer doesn't seem to understand and
exponent without a decimal point.
Any ideas? Here's what I'm using to get/set the value.
protected double increment = 1.0E-6;;
....
[Category("Misc"),
Description("Gets or sets the numeric control increment value."),
DefaultValueAttribute(1.0E-6),
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
TypeConverterAttribute(typeof(DoubleConverter))]
override public object Increment
{
get { return increment; }
set { increment = Convert.ToDouble(value); }
}