创建圆形按钮挺简单的。
public class EllipseButton : Button
{
protected override void OnPaint(PaintEventArgs pevent)
{
GraphicsPath gPath = new GraphicsPath();
// 绘制椭圆形区域
gPath.AddEllipse(0, 0, this.ClientSize.Width, this.ClientSize.Height);
// 将区域赋值给Region
this.Region = new System.Drawing.Region(gPath);
base.OnPaint(pevent);
}
}
来源:https://www.youtube.com/watch?v=U6ciI0Gtb44