Zoury,
You will want to declare your attribute like this:
[DefaultValue(typeof(Color), "ControlText")]
This above line will have the designer look for the Color type. When it
gets it, it will look for the TypeConverter attribute on the type to
indicate what TypeConverter to use. Once it gets that, it will pass the
string "ControlText" to the ConvertFromString method to get the color to
actually use.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Zoury" <ya*************@hotmail.com> wrote in message
news:Oh**************@tk2msftngp13.phx.gbl...
Hey guys! :O)
i'd like to know how would one set a default color property to a system
color ?
as you might guess, this code doesn't work ...
//***
[DefaultValue((object)Color.FromKnownColor(KnownCol or.Window))]
public void MyProp
{
//....
}
//***
thanks in advance!
--
Best Regards
Yanick Lefebvre