ControlPaint.DrawBorder详细参数设置:
private void formMain_Paint(object sender, PaintEventArgs e)
{
Rectangle myRectangle = new Rectangle(0, 0, this.Width, this.Height);
//ControlPaint.DrawBorder(e.Graphics, myRectangle, Color.Blue, ButtonBorderStyle.Solid);//画个边框
ControlPaint.DrawBorder(e.Graphics, myRectangle,
System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(200)))), ((int)(((byte)(105))))), 1, ButtonBorderStyle.Solid, //left
System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(200)))), ((int)(((byte)(105))))), 0, ButtonBorderStyle.Solid, //top
System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(200)))), ((int)(((byte)(105))))), 1, ButtonBorderStyle.Solid, //right
System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(200)))), ((int)(((byte)(105))))), 1, ButtonBorderStyle.Solid //bottom
);
}