using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace NiceStatus
{
public class NiceStatusStrip : StatusStrip
{
protected override void OnPaint(PaintEventArgs e)
{
Graphics grfx = e.Graphics;
using(Pen p = new Pen(Color.FromArgb(86, 125, 176)))
{
grfx.DrawLine(p, 0, 0, Width - 1, 0);
}
grfx.DrawLine(Pens.White, 0, 1, Width - 1, 1);
int height = (Height - 1) / 3;
Rectangle lrect = new Rectangle(0, 2, Width, height);
using(Brush br = new LinearGradientBrush(lrect, Color.FromArgb(215, 230, 249), Color.FromArgb(199, 220, 248), LinearGradientMode.Vertical))
{
grfx.FillRectangle(br, lrect);
}
lrect.Y = lrect.Y + height;
lrect.Height = Height - lrect.Y;
using(Brush br = new LinearGradientBrush(lrect, Color.FromArgb(179, 208, 245), Color.FromArgb(205, 224, 247), LinearGradientMode.Vertical))
{
grfx.FillRectangle(br, lrect);
}
if(SizingGrip)
{
Rectangle sgb = SizeGripBounds;
using(Brush fbr = new SolidBrush(Color.FromArgb(69, 93, 128)))
{
using(Brush bbr = new SolidBrush(Color.FromArgb(177, 201, 232)))
{
grfx.FillRectangle(bbr, new Rectangle(sgb.X + sgb.Width - 3, sgb.Height + sgb.Y - 13, 2, 2));
grfx.FillRectangle(fbr, new Rectangle(sgb.X + sgb.Width - 4, sgb.Y + sgb.Height - 14, 2, 2));
grfx.FillRectangle(bbr, new Rectangle(sgb.X + sgb.Width - 3, sgb.Height + sgb.Y - 9, 2, 2));
grfx.FillRectangle(fbr, new Rectangle(sgb.X + sgb.Width - 4, sgb.Y + sgb.Height - 10, 2, 2));
grfx.FillRectangle(bbr, new Rectangle(sgb.X + sgb.Width - 3, sgb.Height + sgb.Y - 5, 2, 2));
grfx.FillRectangle(fbr, new Rectangle(sgb.X + sgb.Width - 4, sgb.Y + sgb.Height - 6, 2, 2));
grfx.FillRectangle(bbr, new Rectangle(sgb.X + sgb.Width - 7, sgb.Height + sgb.Y - 9, 2, 2));
grfx.FillRectangle(fbr, new Rectangle(sgb.X + sgb.Width - 8, sgb.Y + sgb.Height - 10, 2, 2));
grfx.FillRectangle(bbr, new Rectangle(sgb.X + sgb.Width - 7, sgb.Height + sgb.Y - 5, 2, 2));
grfx.FillRectangle(fbr, new Rectangle(sgb.X + sgb.Width - 8, sgb.Y + sgb.Height - 6, 2, 2));
grfx.FillRectangle(bbr, new Rectangle(sgb.X + sgb.Width - 11, sgb.Height + sgb.Y - 5, 2, 2));
grfx.FillRectangle(fbr, new Rectangle(sgb.X + sgb.Width - 12, sgb.Y + sgb.Height - 6, 2, 2));
}
}
}
base.OnPaint(e);
}
}
}
peace & serenity
|