title: How to get proper bounds for a C# Windows Forms Panel to draw a border
body: <p>So I am trying to draw a bottom border for a panel. I have this code:</p>
  
  <pre><code>private void pnl_Paint(object sender, PaintEventArgs e)
  {
      ControlPaint.DrawBorder(e.Graphics, ((Panel)sender).ClientRectangle, Color.Transparent, 0, ButtonBorderStyle.None, Color.Transparent, 0, ButtonBorderStyle.None, Color.Transparent, 0, ButtonBorderStyle.None, SystemColors.ControlDarkDark, 1, ButtonBorderStyle.Solid);
  }
  </code></pre>
  
  <p>I have also replaced ClientRectange with DisplayRectangle and Bounds, and all of them produce the same result, the one in the picture.</p>
  
  <p>I am trying to achieve a bottom border going all the way across the peach background (used to display the size of the panel)</p>
  
  <p><img src="https://i.stack.imgur.com/PoKUF.png" alt="screenshot"></p>