日期:2014-05-18 浏览次数:21200 次
public class Define : System.Windows.Forms.UserControl
{
private int a;
public Define() : base()
{
this.a = -1;
}
//自定义属性...
public Int32 A
{
get
{
return this.a;
}
set
{
this.a = value;
}
}
}
------解决方案--------------------
簡簡單單.. 好像是对的
------解决方案--------------------
是要写一个自定义类型的PropertyGrid的编辑界面吧,
在属性上(或者属性的类型上)添加Editor特性,例如:[Editor("你的UITypeEditor类型的AssemblyQualifiedName", typeof(UITypeEditor))]
再去实现UITypeEditor(不会的话就随便反编译一个System.Drawing.Design.dll或者System.Windows.Forms.Design.dll中的类抄一下就行了)
------解决方案--------------------
bool visible;
public bool Visible
{
get
{
return visible;
}
set
{
visible = value;
}
}