Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set DefaultValue for a color
Message
From
23/06/2007 12:01:49
 
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
01234513
Message ID:
01235183
Views:
21
>>Yes, when reset is used from the properies sheet it will error. I'll try Bonnie's sugestion later today.
>
>What does changing the value from the property browser have to do with setting the default color? Use the TypeConverter for that: TypeConverter(GetType(System.Drawing.ColorConverter))


Right-click on the Property and choose "Reset" and it will attempt to reset the Property to whatever's specified with the [DefaultValue] attribute. If it's coded wrong then it will error. You suggested he try [DefaultValue("Blue")], which obviously doesn't work.

Where does your above suggestion (the TypeConverter) fit in? I'll admit I don't totally understand VB, but the [DefaultValue] attribute is not a language-specific thing. To be honest, I don't know if my suggestion will work either, [DefaultValue(GetType(System.Drawing.Color), "Blue")], because I don't have VB loaded to check it out ... but I'm trying to figure out the difference between our two replies.

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

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

Click here to load this message in the networking platform