class TestComponent2 : System.Windows.Forms.DateTimePicker
{
[TypeConverter(typeof(ExpandableObjectConverter))]
public class Test
{
private int _A, _B;
[Description("属性B")]
public int B
{
get { return _B; }
set { _B = value; }
}
[Description("属性A")]
public int A
{
get { return _A; }
set { _A = value; }
}
public override string ToString()
{
return _A+","+_B;
}
}
private Test _Test;
[Description("自定义控件,里面含有结构体(类)"),Category("MyCategory")]
public Test TestProperty
{
get { return _Test; }
set { _Test = value; }
}
}
如何在自定义控件里添加复杂属性(struct,class等)
最新推荐文章于 2024-06-09 01:03:07 发布