Share via


How to: Create a Shaped Form

The following example gives a form an elliptical shape.

Example

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);

Compiling the Code

To use this code, copy it to the Form1_Load event handler.

The Region property of the Form class is an advanced member.

See Also

Concepts

Designing a User Interface in Visual C#

Other Resources

Customizing, Displaying, and Printing Windows Forms

Visual C# Guided Tour