创建区域
并赋值给窗体的Regions属性
例子:三角形窗体
//创建路径
Point[] poly = { new Point(0,0),new Point(800,0),new Point(110,200)};
System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
path.AddPolygon(poly);
//创建区域
Region region = new Region(path);
//设置窗口的区域
this.Region = region;