Multimobile Development: Building Applications for any Smartphone
DefaultValueAttribute
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.csharp.


Dulovits M.
GOOD ANSWER
I want a default value for this color property ( with
System.ComponentModel.DefaultValue ) but it doesnt work ..
any hints or ideas what ive done wrong ??

[System.ComponentModel.Category("Border")]
[System.ComponentModel.DefaultValue(typeof
System.Drawing.Color),"Yellow")]
[System.ComponentModel.Description("Color of the BorderGradient.")]

public System.Drawing.Color GradientColor
{
get ...
set ...
}

thx in advance

dulo
Reply to this message...
Vote that this is a GOOD answer... (2 votes from other users already)
 
 
    
Vijaye Raji
The attribute is just a hint. It lets others understand about the default
value for the property - for example, the property grid will use the
DefaultValue attribute to let users reset it.

If you want your property to have an initial value, you need to explicitly
set it in the constructor.

HTH

-vJ

"Dulovits M." <Click here to reveal e-mail address> wrote in message
news:c9nmco$a33$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
Really good experience at the Apple Store
MonoDroid – looking *awesome*
 
 
System.Drawing.Color




Ad
BootFX
Reliable and powerful .NET application framework.
iOS, Android and Windows Phone Development Training and Consultancy
Hosted by RackSRV Communications
 
Multimobile Development: Building Applications for any Smartphone
Copyright © AMX Software Ltd 2008-2010. Portions copyright © Matthew Baxter-Reynolds 2001-2010. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - 4.0.30129.1734