Corner属性在属性列表中显示正确,该属性实际上未在Form1.Designer.cs文件中更改。下面是定义属性的代码:
private Corner _corner = new Corner(true, true, true, true);
[Description("Which corners should be rounded"), Category("Look"), Browsable(true)]
[DefaultValue(typeof(Corner),"True,True,True,False")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public Corner Corners {
get { return _corner; }
set
{
if (value == _corner) return;
_corner = value;
Invalidate();
}
}
这是我的Form1.Designer.cs文件在InitializeComponent方法中创建的代码:
//
this.flatButton1.Location = new System.Drawing.Point(302, 270);
this.flatButton1.Name = "flatButton1";
this.flatButton1.Size = new System.Drawing.Size(150, 46);
this.flatButton1.TabIndex = 5;
this.flatButton1.Text = "flatButton1";
//