So I am trying to draw a bottom border for a panel. I have this 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);
}
I have also replaced ClientRectange with DisplayRectangle and Bounds, and all of them produce the same result, the one in the picture.
I am trying to achieve a bottom border going all the way across the peach background (used to display the size of the panel)

Change your Padding property to the following:
Since you are just trying to draw a line, draw a line:
And make sure to invalidate on the resize: