将button按钮绘制成圆形按钮,做状态灯指示(winform)

程序初始化的时候:
    先引用

           using System.Drawing.Drawing2D;

 

 

            GraphicsPath myPath = new GraphicsPath();
            myPath.AddEllipse(5, 5,150, 150);

          
            this.button1.Region = new Region(myPath);
            this.button2.Region = new Region(myPath);
            this.button3.Region = new Region(myPath);
            this.button4.Region = new Region(myPath);

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页