void DrawBorder(Graphics g)
{
Rectangle rc = ClientRectangle;
if ( borderType == BorderType.FixedSingle )
{
g.DrawRectangle(Pens.Black, rc.Left, rc.Top, rc.Width-1, rc.Height-1);
}
else if ( borderType == BorderType.Fixed3D )
{
ControlPaint.DrawBorder3D(g, rc, Border3DStyle.Sunken);
}
else if ( borderType == BorderType.Custom )
{
using (Pen p1 = new Pen(leftTopColor),
p2 = new Pen(RightBottomColor))
{
g.DrawRectangle(p1, rc.Left, rc.Top, rc.Width-1, rc.Height-1);
g.DrawRectangle(p2, rc.Left+1, rc.Top+1, rc.Width-3, rc.Height-3);
}
}
}