private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { System.Drawing.Drawing2D.GraphicsPath myPath = new System.Drawing.Drawing2D.GraphicsPath(); myPath.AddEllipse(0,0, 1000, 1000); this.Region = new Region(myPath); }
myPath.AddEllipse(20, 30, 1000, 1000);后面的4個參數分別表示運行開始的時候 圓型窗體所展示出的原本窗體的位置(因為原本窗體大於圓形窗體 相當於圓形窗體在原本窗體的 top left)和窗體的 Width 和 Height
寫完之后直接運行就OK了
