Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DefaultValue for Color property
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01023484
Message ID:
01023534
Views:
13
Neil,
Thanks for the reply. It works, well kind of works. Now it appears I have a different problem. When I right-click the property and select Reset it changes it to Red (or what ever default color is), but when I build the project the instance of the control on the form changes the color property to nothing.
Have you seen something like this?
If I change the property to a different color than the default color the color stays. Does it work correctly for you?

Einar

>Einar,
>
>You need to provide a string as the second parameter for the DefaultValue attribute.
>
>[Category("Appearance")]
>[Description("Specifies the colour of the controls border.")]
>[DefaultValue(typeof(System.Drawing.Color), "255, 0, 0")]
>public Color BorderColor
>{
>   get { return _borderColor; }
>   set
>   {
>      if (value != _borderColor)
>      {
>         _borderColor = value;
>         base.Invalidate();
>      }
>   }
>}
>
>The example above specifies a default colour of Red.
>
>Regards
>Neil
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform