title: Custom rounded button with outline
body: <p>I am tring to create a custom button width rounded corner and a white outline which follows its shape. On the OnPaint event I've added the following code.</p>
  
  <pre><code>Public Class RoundedButton
      Protected Overrides Sub OnPaint(e As PaintEventArgs)
          MyBase.OnPaint(e)
          Dim grPath As GraphicsPath = New GraphicsPath(FillMode.Winding)
          grPath.AddArc(0, 0, ClientSize.Height, ClientSize.Height, 90, 180)
          grPath.AddLine(grPath.GetLastPoint, New Point(ClientSize.Width - grPath.GetLastPoint.X * 2, 0))
          grPath.AddArc(New RectangleF(grPath.GetLastPoint, New Size(ClientSize.Height, ClientSize.Height)), 270, 180)
          grPath.CloseFigure()
  
          Me.Region = New Region(grPath)
  
          Dim mypen As New Pen(Color.White, 2)
          mypen.Alignment = PenAlignment.Inset
          e.Graphics.DrawPath(mypen, grPath)
      End Sub
  End Class
  </code></pre>
  
  <p>If I try to use it in a form, it works only if Backcolor property is set to Transparent. If not I can't see the pen path.
  I would like to change the backcolor without loose the rounded white border of the pen.
  I would like to obtain something like this:
  <img src="https://i.stack.imgur.com/ohWhD.png" alt="enter image description here"></p>