How to make Non Rectangular Winforms?

I am using the code below to change the form of winform. His change of form, but not the way I wanted. I need shapes to have curved corners.

What points should be used to obtain it?

public void MakeNonRectangularForm() { System.Drawing.Drawing2D.GraphicsPath p = new System.Drawing.Drawing2D.GraphicsPath(); int width = this.ClientSize.Width; int height = this.ClientSize.Height; p.AddClosedCurve(new Point[]{new Point(width/2, height/2), new Point(width,0), new Point(width, height/3), new Point(width-width/3, height), new Point(width/7, height-height/8)}); this.Region = new Region(p); } 
+3
source share
1 answer

Below is some code that I used to create rounded edges earlier, using AddArc and lines to combine the border:

(You can play with xRadius and yRadius to achieve the desired amount of rounding)

 int xRadius = {insert value here}; int yRadius = {insert value here}; GraphicsPath edge = new GraphicsPath(); int rightHandLeft = this.Width - xRadius - 1; int bottomSideTop = this.Height - yRadius - 1; edge.AddArc(0, 0, xRadius, yRadius, 180, 90); edge.AddLine(xRadius, 0, rightHandLeft, 0); edge.AddArc(rightHandLeft, 0, xRadius, yRadius, 270, 90); edge.AddLine(this.Width, yRadius, this.Width, bottomSideTop); edge.AddArc(rightHandLeft, bottomSideTop, xRadius, yRadius, 0, 90); edge.AddLine(rightHandLeft, this.Height, xRadius, this.Height); edge.AddArc(0, bottomSideTop, xRadius, yRadius, 90, 90); edge.AddLine(0, bottomSideTop, 0, yRadius); this.Region = new Region(edge); 
+2
source

All Articles