You must customize your own Panelwith a small custom picture:
private void panel1_Paint(object sender, PaintEventArgs e){
if(panel1.BorderStyle == BorderStyle.FixedSingle){
int thickness = 3;
int halfThickness = thickness/2;
using(Pen p = new Pen(Color.Black,thickness)){
e.Graphics.DrawRectangle(p, new Rectangle(halfThickness,
halfThickness,
panel1.ClientSize.Width-thickness,
panel1.ClientSize.Height-thickness));
}
}
}
Here is a screenshot of the panel with a thickness 30:

NOTE . The size is Rectanglecalculated in the middle of the line of the drawing, suppose you draw a line with a thickness 4, there will be an offset of 2 outside and 2 inside.
, Mr Hans, SizeChanged panel1 :
private void panel1_SizeChanged(object sender, EventArgs e){
panel1.Invalidate();
}
ResizeRedraw = true Reflection SizeChanged, :
typeof(Control).GetProperty("ResizeRedraw", BindingFlags.NonPublic | BindingFlags.Instance)
.SetValue(panel1, true, null);
, , doubleBuffered 1:
typeof(Panel).GetProperty("DoubleBuffered",
BindingFlags.NonPublic | BindingFlags.Instance)
.SetValue(panel1,true,null);