protected override void OnPaint(PaintEventArgs e)
{
if (this.coloredBorders)
{
e.Graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
IntPtr hWnd = this.Handle;
IntPtr hRgn = IntPtr.Zero;
IntPtr hdc = GetDCEx(hWnd, hRgn, 1027);
using (Graphics grfx = Graphics.FromHdc(hdc))
{
Rectangle thicRect = new Rectangle(1, 1, this.Width - 3, this.Height - 3);
Rectangle thinRect = new Rectangle(0, 0, this.Width - 1, this.Height - 1);
Pen thickPen = new Pen(borderColor, 2F);
Pen thinPen = new Pen(Color.Black, 1F);
//grfx.DrawRectangle(pen, rect)
drawRoundRect(grfx, thickPen, thicRect, 3);
drawRoundRect(grfx, thinPen, thinRect, 3);
}
}
base.OnPaint(e);
}