title: Creating Smooth Rounded Corners in WinForm Applications
body: <p>I want to create a button and a container with rounded corners.
  I'm using the Region to paint the corners, code attached below.
  However the corners doesn't seem smooth, is there any way to fix this, any help would be appreciated.
  Image attached below as im not allowed to upload images yet.</p>
  <p><a href="https://i.stack.imgur.com/kJmi1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kJmi1.png" alt="enter image description here" /></a></p>
  <pre><code>[DllImport(&quot;Gdi32.dll&quot;, EntryPoint = &quot;CreateRoundRectRgn&quot;)]
          private static extern IntPtr CreateRoundRectRgn(
              int nLeftRect,
              int nTopRect,
              int nRightRect,
              int nBottomRect,
              int nWidthEllipse,
              int nHeightEllipse
              );
  </code></pre>
  <pre><code>  public Login()
          {
              InitializeComponent();
              this.Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 30, 30));
              this.logo.Image = Properties.Resources.logo;
              this.btn_login.Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, this.btn_login.Width, this.btn_login.Height, 10, 10));
  
          }
  
  </code></pre>