title: How can I get rid of the original border on a label when drawing my own?
body: <p>I have created a label control that inherits from Label and allows a border to be drawn with colour and size to be applied set in properties, as long as the border style is fixed single.  This works fine except that despite drawing the new border after calling base the original border is still drawn:</p>
  
  <p><a href="https://i.stack.imgur.com/jKHiQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jKHiQ.png" alt="Label comparison"></a></p>
  
  <p>Clearly I want to show only the new border and not the original.  Here is the code in the control:</p>
  
  <pre><code>    protected override void OnPaint(PaintEventArgs e)
      {
          base.OnPaint(e);
  
          if (BorderStyle == BorderStyle.FixedSingle)
          {
              ControlPaint.DrawBorder(e.Graphics, DisplayRectangle, _borderColor, BorderWidth,
                  ButtonBorderStyle.Solid, _borderColor, BorderWidth, ButtonBorderStyle.Solid, _borderColor,
                  BorderWidth, ButtonBorderStyle.Solid, _borderColor, BorderWidth, ButtonBorderStyle.Solid);
          }
      }
  </code></pre>
  
  <p>And here the code to generate the two labels for comparison:</p>
  
  <pre><code>    private void labelButton_Click(object sender, EventArgs e)
      {
          var label = new AdvancedLabel
          {
              BorderColor = Color.Yellow,
              BorderStyle = BorderStyle.FixedSingle,
              BorderWidth = 3,
              Location = new Point(10, 10),
              Text = @"Advanced Label",
              TextAlign = ContentAlignment.MiddleCenter
          };
  
          Controls.Add(label);
  
          var label2 = new Label
          {
              BorderStyle = BorderStyle.FixedSingle,
              Location = new Point(10, 35),
              Text = @"Standard Label",
              TextAlign = ContentAlignment.MiddleCenter
          };
  
          Controls.Add(label2);
      }
  </code></pre>
  
  <p>So, can anyone tell me what I am missing here?  I have tried everything I can think of!!</p>