2012-09-27 55 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; } 
相關問題