将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);

 

赞(1) 打赏
未经允许不得转载:TaKaSa » 将button按钮绘制成圆形按钮,做状态灯指示(winform)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  • Q Q(选填)

赞助下

支付宝扫一扫打赏

微信扫一扫打赏