Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to set DefaultValue for a color
Message
De
21/06/2007 11:17:27
 
 
À
20/06/2007 11:49:25
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
01234513
Message ID:
01234726
Vues:
14
Brian,

Do it this way:
[DefaultValue(typeof(System.Drawing.Color), "Blue")]
Hmmm ... I think "typeof" is only C#? I'm not sure, but I think that's "CType" in VB?

~~Bonnie


>I'm trying to set the DefaultValue for a property in a custom control but cant figure out how to set it for a color.
>
><Category("Thumbnail Pannel"), _
>           Description("Back Color of Selected Thumbnail"), _
>           DefaultValue(System.Drawing.Color.Blue)> _
>       Public Property SelectedThumbBackColor() As Color
>
> I get an error "Constant expression expected".
>Anyone know how to set this up for a color?
>
>Thanks
>Brian Grant
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