2012-09-27 61 views
3

我有一个propertygrid myclass是它的对象。在我的班级中,我定义了Size类型的一个项目。如何在项目属性中设置默认值?如何在c#中将默认值设置为propertyygrid的大小类型属性?

请看看我的代码:

[CategoryAttribute("Information"), DefaultValue(Size(0, 0))] 
public Size AndaazehPixel { get; set; } 

我的错误: 'System.Drawing.Size' 是 '型',而是使用类似 '变量'

回答

5

试试这样说:

[DefaultValue(typeof(Size), "0, 0")] 
public Size AndaazehPixel { get; set; } 
相关问题