Making Login form's corners as smooth curves for appearance

This is an article, Just shown how to make the corners of the login form as curvers to improve the apearance.Recently I had done some code to improve the appearance of the login screen for one of my windows application. After doing this a small bit of change it added a value to the whole application as it look good. Hope this may help the developers to add a value to their application too.

This is a few set of lines of code to implement the logic.

Just before going for the code Select an image and set that image as a background for the login form or the form which you need using the BACKGROUND property of the form.

Add this following set of code in the code behind

using System.Drawing.Drawing2D;

Include this above namespace

public static GraphicsPath RoundRect(Rectangle rectangle, int roundRadius)
Rectangle innerRect = Rectangle.Inflate(rectangle, -roundRadius, -roundRadius);
GraphicsPath path = new GraphicsPath();


path.AddArc(RoundBounds(innerRect.Right - 1, innerRect.Bottom - 1, roundRadius), 0, 90);
path.AddArc(RoundBounds(innerRect.Left, innerRect.Bottom - 1, roundRadius), 90, 90);
path.AddArc(RoundBounds(innerRect.Left, innerRect.Top, roundRadius), 180, 90);
path.AddArc(RoundBounds(innerRect.Right - 1, innerRect.Top, roundRadius), 270, 90);


return path;

private static Rectangle RoundBounds(int x, int y, int rounding)
return new Rectangle(x - rounding, y - rounding, 2 * rounding, 2 * rounding);

Place this above code in your form and call this function in the form load event.

GraphicsPath oPath = new GraphicsPath();
oPath = RoundRect(this.ClientRectangle, 15);
this.Region = new Region(oPath);

Hope this code snippet will add some appearance to your application.


Author: Sibtain02 Jun 2011 Member Level: Gold   Points : 1

Thanks Marshal. Making the corners of the form curvy. But it will look better if we can make the curve smoother.

Author: Marshal03 Jun 2011 Member Level: Silver   Points : 1

Thanks for your response and will try it out your suggession and will update it if I found.

Author: Sibtain08 Jun 2011 Member Level: Gold   Points : 1

Yes. I am also searching for same. If I get something useful then I'll update you. Keep up the good work.

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: