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); }
}

Re: Forms designer load error. by Frank

Frank
Thu Nov 04 13:21:00 CST 2004

If you change the property type to double everything may work fine.

Regards,
Frank Hileman

check out VG.net: www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor

"GP" <GP@discussions.microsoft.com> wrote in message
news:CA10CB89-9F37-44B3-B9CF-B154EDFACC23@microsoft.com...
>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); }
> }
>



Re: Forms designer load error. by Claes

Claes
Fri Nov 05 02:31:19 CST 2004

And remove the DesignerSerializationVisibility
and TypeConverter attributes. You don't need them.

/claes

"Frank Hileman" <frankhil@no.spamming.prodigesoftware.com> wrote in message
news:esLirNqwEHA.1400@TK2MSFTNGP11.phx.gbl...
> If you change the property type to double everything may work fine.
>
> Regards,
> Frank Hileman
>
> check out VG.net: www.vgdotnet.com
> Animated vector graphics system
> Integrated Visual Studio .NET graphics editor
>
> "GP" <GP@discussions.microsoft.com> wrote in message
> news:CA10CB89-9F37-44B3-B9CF-B154EDFACC23@microsoft.com...
> >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); }
> > }
> >
>
>



Re: Forms designer load error. by GP

GP
Fri Nov 05 11:00:05 CST 2004


Thanks, this looked good until I realized that this parameter is inherited
from a base class where it wouldn't be appropriate to change the type to
double.

"Frank Hileman" wrote:

> If you change the property type to double everything may work fine.
>
> Regards,
> Frank Hileman
>
> check out VG.net: www.vgdotnet.com
> Animated vector graphics system
> Integrated Visual Studio .NET graphics editor
>
> "GP" <GP@discussions.microsoft.com> wrote in message
> news:CA10CB89-9F37-44B3-B9CF-B154EDFACC23@microsoft.com...
> >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); }
> > }
> >
>
>
>