共用方式為


HOW TO:建立具形狀的表單 (Visual C#)

更新: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 屬性是進階成員。

請參閱

概念

在 Visual C# 中設計使用者介面

其他資源

自訂、顯示和列印 Windows Form

Visual C# 導覽