我想在C#中做一个圆形控件,新建了一个类
public class MyButton: Button
{
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
base.OnPaint(e);
System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
path.AddEllipse(0, 0, this.Width, this.Height);
this.Region = new Region(path);
}
}
编译完成后,在工具箱中没找到重绘的按钮控件,请问怎么重绘控件以及怎样应用它?
------解决思路----------------------
自己new一个
------解决思路----------------------
菜单,“生成”→“重新生成”

------解决思路----------------------
不可能没有,重新编译下,不行关闭了再打开。
------解决思路----------------------
我的自动出现在工具箱里