Example to change windows form shape using c#

September 20, 2015 , 0 Comments

In this article i will show you, how to change the shape of the current form. The default form shape is square and i want to change it in ellipse form. Copy this code and paste into your code file.


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication2
    public partial class Form3 : Form
        public Form3()
        protected override void OnPaint(PaintEventArgs e)
            System.Drawing.Drawing2D.GraphicsPath shape1 = new System.Drawing.Drawing2D.GraphicsPath();
            shape1.AddEllipse(0, 0,this.Width, this.Height);
            this.Region = new System.Drawing.Region(shape1);
Code generate  the following output

Example to change windows form shape using c#

Jacob Lefore

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google