Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set DefaultValue for a color
Message
From
22/06/2007 15:45:32
 
 
To
22/06/2007 09:48:26
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
01234513
Message ID:
01235094
Views:
24
Brian,

OK, so I was wrong about CType ... I don't know VB, but I'm sure there's a way to do this in VB. Doesn't GetType() work:
[DefaultValue(GetType(System.Drawing.Color), "Blue")]
~~Bonnie



>Bonnie,
>That wont do it. Ctype wont convert a string to a color. DefaultValue errors on everything ive tried so far for this because it requires a constant value. for now I'll just remove the default. This only affects the reset in the properies window. The actual default is picked up when the private var that stores the field is initialized.
>
>Thanks
>Brian Grant
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform