c# 重写控件怎么定义像Font、Size等那样可以展开的属性
c# 重写控件如何定义像Font、Size等那样可以展开的属性?
像Font、Size等属性那样可以展开然后里面可以设置很多子属性
------解决方案--------------------
差不多就是这样了:
像Font、Size等属性那样可以展开然后里面可以设置很多子属性
------解决方案--------------------
struct demo1
{
public int num;
public string name;
public void fortry()
{
this.num = 0;
}
}
public class demo2
{
public string name;
public int length;
public Byte[] bytes;
public demo2()
{
}
public demo2(string filename)
{
name = filename;
FileStream fs = new FileStream(filename, FileMode.Open);
try
{
BinaryReader r = new BinaryReader(fs);
r.BaseStream.Seek(0, SeekOrigin.Begin);
bytes = new Byte[(int)r.BaseStream.Length];
length = (int)r.BaseStream.Length;
bytes = r.ReadBytes((int)r.BaseStream.Length);
}
catch
{
}
}
}
public class myButton : System.Windows.Forms.Button
{
public demo1 struct1;
public demo2 class2;
}
差不多就是这样了: