Topaz Filer: if you use e-mail for business, we can save you money and decrease your risk.
DefaultValueAttribute
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.csharp.


Dulovits M.
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...
 
Auto-following on Twitter
Ubuntu and XP on one “desktop”
 
    
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...
 
Outlook interop - stopping user properties appearing on Outlook message print
Seriously, why is “cut and paste” majorly newsworthy???
 
 
System.Drawing.Color




Ad
BootFX
Reliable and powerful .NET application framework.
Recession Busting Bespoke Software
Get through the recession by investing in bespoke software to decrease costs and create commercial opportunities.
Other DN247 Network Sites
.NET 247
SQL Server Wins
Old Skool Developer
 
Copyright © AMX Software Ltd 2008-2009. Portions copyright © Matthew Baxter-Reynolds 2001-2009. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - .NET 247 is a member of the DN247 Network - 4.0.30129.1734