我們看到的WinForm總是方形的
但可以改成圓形或是多邊形
(在設計畫面看不到,一定要動態更改)
System.Drawing.Drawing2D.GraphicsPath myPath =
new
System.Drawing.Drawing2D.GraphicsPath();
//圓形
myPath.AddEllipse(0, 0, this.Width, this.Height);
Region myRegion = new Region(myPath);
this.Region = myRegion;
也可以用多邊形如下
myPath.AddPolygon(new Point[] { new Point(0, 0), new Point(0,
this.Height),
new Point(this.Width, 0) });
全站熱搜