Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to set DefaultValue for a color
Message
De
23/06/2007 12:01:49
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
01234513
Message ID:
01235183
Vues:
20
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform