protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (this.DockPane.DockState != DockState.Document)
return;
Graphics g = e.Graphics;
Rectangle rect = ClientRectangle;
if (this.Alignment == DockAlignment.Top || this.Alignment == DockAlignment.Bottom)
g.DrawLine(SystemPens.ControlDark, rect.Left, rect.Bottom - 1, rect.Right, rect.Bottom - 1);
else if (this.Alignment == DockAlignment.Left || this.Alignment == DockAlignment.Right)
g.DrawLine(SystemPens.ControlDarkDark, rect.Right - 1, rect.Top, rect.Right - 1, rect.Bottom);
}