Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DefaultValue for System.Drawing.SystemColors

I have a line color property in my custom grid control. I want it to default to Drawing.SystemColors.InactiveBorder. I tried:

[DefaultValue(typeof(System.Drawing.SystemColors), "InactiveBorder")]
public Color LineColor { get; set; }

But it doesn't seem to work. How do I do that with the default value attribute?

like image 758
Ozgur Ozcitak Avatar asked Dec 08 '22 09:12

Ozgur Ozcitak


1 Answers

You need to change first argument from SystemColors to Color.
It seems that there is no type converter for the SystemColors type, only for the Color type.

[DefaultValue(typeof(Color),"InactiveBorder")]
like image 92
aku Avatar answered Dec 09 '22 23:12

aku