更新:2007 年 11 月
下列範例會提供橢圓形的表單。
範例
System.Drawing.Drawing2D.GraphicsPath shape =
new System.Drawing.Drawing2D.GraphicsPath();
shape.AddEllipse(0, 0, this.Width, this.Height);
this.Region = new System.Drawing.Region(shape);
編譯程式碼
若要使用這個程式碼,請將它複製到 Form1_Load 事件處理常式。
Form 類別的 Region 屬性是進階成員。