protected override void OnPaintBackground(PaintEventArgs e) {
// base.OnPaintBackground(e);
BufferedGraphics g;
BufferedGraphicsContext context = BufferedGraphicsManager.Current;
context.MaximumBuffer= new Size(Width, Height);
g = context.Allocate(e.Graphics, new Rectangle(0, 0, Width, Height));
FormRegions.Left = new Rectangle(0, 6, 5, ClientSize.Height - 12);
FormRegions.Right = new Rectangle(ClientSize.Width - 5, 6, 5, ClientSize.Height - 12);
FormRegions.Top = new Rectangle(6, 0, ClientSize.Width - 12, 5);
FormRegions.TopLeft = new Rectangle(0, 0, 6, 6);
FormRegions.TopRight = new Rectangle(ClientSize.Width - 6, 0, 6, 6);
FormRegions.Bottom = new Rectangle(6, ClientSize.Height - 5, ClientSize.Width - 12, 5);
FormRegions.BottomLeft = new Rectangle(0, ClientSize.Height - 6, 6, 6);
FormRegions.BottomRight = new Rectangle(ClientSize.Width - 6, ClientSize.Height - 6, 6, 6);
FormRegions.Caption = new Rectangle(5, 5, ClientSize.Width - 10, SkinImage.Caption.Height);
FormRegions.Background = new Rectangle(5, 5, ClientSize.Width - 10, ClientSize.Height - 10);
g.Graphics.FillRectangle(Brushes.White, FormRegions.Background);
g.Graphics.DrawImage(SkinImage.Caption, FormRegions.Caption, 0, 0,
SkinImage.Caption.Width, SkinImage.Caption.Height,
GraphicsUnit.Pixel, SkinAttributes);
g.Graphics.DrawImage(SkinImage.CaptionLeft, 5, 5,
SkinImage.CaptionLeft.Width, SkinImage.CaptionLeft.Height);
g.Graphics.DrawImage(SkinImage.CaptionRight, FormRegions.Caption.Width + 4, 5,
SkinImage.CaptionRight.Width, SkinImage.CaptionRight.Height);
g.Graphics.DrawImage(SkinImage.Left, FormRegions.Left, 0, 0, SkinImage.Left.Width,
SkinImage.Left.Height, GraphicsUnit.Pixel, SkinAttributes);
g.Graphics.DrawImage(SkinImage.Right, FormRegions.Right, 0, 0, SkinImage.Right.Width,
SkinImage.Right.Height, GraphicsUnit.Pixel, SkinAttributes);
g.Graphics.DrawImage(SkinImage.Top, FormRegions.Top, 0, 0, SkinImage.Top.Width,
SkinImage.Top.Height, GraphicsUnit.Pixel, SkinAttributes);
g.Graphics.DrawImage(SkinImage.TopLeft, FormRegions.TopLeft);
g.Graphics.DrawImage(SkinImage.TopRight, FormRegions.TopRight);
g.Graphics.DrawImage(SkinImage.Bottom, FormRegions.Bottom, 0, 0,
SkinImage.Bottom.Width, SkinImage.Bottom.Height,
GraphicsUnit.Pixel, SkinAttributes);
g.Graphics.DrawImage(SkinImage.BottomLeft, FormRegions.BottomLeft);
g.Graphics.DrawImage(SkinImage.BottomRight, FormRegions.BottomRight);
g.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
g.Graphics.DrawString(Text, new Font(Font.Name, 15, Font.Style), Brushes.Black, new PointF(47, 11));
g.Render(e.Graphics);
}