Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to set DefaultValue for a color
Message
De
22/06/2007 15:45:32
 
 
À
22/06/2007 09:48:26
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
01234513
Message ID:
01235094
Vues:
23
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform