Reputation: 2417
I have a propertygrid that myclass is objectsource of it. In my class I define one item from Size type. How can I set default value in item attribute ?
Please see my code :
[CategoryAttribute("Information"), DefaultValue(Size(0, 0))]
public Size AndaazehPixel { get; set; }
my error : 'System.Drawing.Size' is a 'type' but is used like a 'variable'
Upvotes: 4
Views: 2311
Reputation: 81675
Try it like this:
[DefaultValue(typeof(Size), "0, 0")]
public Size AndaazehPixel { get; set; }
Upvotes: 9