C#用GDI画任意形状的form代码:代码放在窗体Paint事件中:
List list = new List();//首先构构造好窗体的边缘的点
list.Add(new Point(0, 4));
...//添加边缘点到list
Point[] points = list.ToArray();//将点集合赋给点数组
GraphicsPath shape = new GraphicsPath();
shape.AddPolygon(points);
//将窗体转换为构造好的点形成的形状
this.Region = new System.Drawing.Region(shape);