protected override void OnResize(System.EventArgs e)
{
base.OnResize(e);
if (Width > 0 && Height > 0)
{
Shape = new GraphicsPath();
R1 = new Rectangle(0, 0, Width, Height);
InactiveGB = new LinearGradientBrush(new Rectangle(0, 0, Width, Height), Color.FromArgb(181, 41, 42), Color.FromArgb(181, 41, 42), 90.0F);
PressedGB = new LinearGradientBrush(new Rectangle(0, 0, Width, Height), Color.FromArgb(165, 37, 37), Color.FromArgb(165, 37, 37), 90.0F);
}
Shape.AddArc(0, 0, 10, 10, 180, 90);
Shape.AddArc(Width - 11, 0, 10, 10, -90, 90);
Shape.AddArc(Width - 11, Height - 11, 10, 10, 0, 90);
Shape.AddArc(0, Height - 11, 10, 10, 90, 90);
Shape.CloseAllFigures();
Invalidate();
}