Friday, April 1, 2011

Create Round Form in C# Application

1) Create Simple Window Application (C#).

2) in the form set below property.

startposition : CenterScreen
MaximizeBox :False
MinimizeBox :False
Size :
Width :400
Height:400
FormBorderStyle :none

3) in the form paint event put below code.

private void Form1_Paint(object sender, PaintEventArgs e)
{
System.Drawing.Drawing2D.GraphicsPath objGP = new System.Drawing.Drawing2D.GraphicsPath();
objGP.AddEllipse(new Rectangle(0, 0,this.Width, this.Height));
this.Region = new Region(objGP);
this.FormBorderStyle = FormBorderStyle.None;
}

-
Thnx..

No comments: