示例#1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics     g      = e.Graphics;
            GraphicsPath GP     = default(GraphicsPath);
            Rectangle    Base   = new Rectangle(0, 0, Width, Height);
            var          _with7 = g;

            _with7.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
            _with7.SmoothingMode     = SmoothingMode.HighQuality;
            _with7.PixelOffsetMode   = PixelOffsetMode.HighQuality;
            _with7.Clear(BackColor);
            TB.BackColor = Color.FromArgb(42, 42, 42);
            TB.ForeColor = Color.FromArgb(255, 255, 255);
            switch (_Style)
            {
            case Styles.Rounded:
                GP = DrawHelpers.RoundRectangle(Base, 6);
                _with7.FillPath(new SolidBrush(Color.FromArgb(42, 42, 42)), GP);
                _with7.DrawPath(new Pen(new SolidBrush(Color.FromArgb(35, 35, 35)), 2), GP);
                GP.Dispose();
                break;

            case Styles.NotRounded:
                _with7.FillRectangle(new SolidBrush(Color.FromArgb(42, 42, 42)), new Rectangle(0, 0, Width - 1, Height - 1));
                _with7.DrawRectangle(new Pen(new SolidBrush(Color.FromArgb(35, 35, 35)), 2), new Rectangle(0, 0, Width, Height));
                break;
            }
            _with7.InterpolationMode = (InterpolationMode)7;
        }
示例#2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics     G      = e.Graphics;
            GraphicsPath GP     = default(GraphicsPath);
            Rectangle    Base   = new Rectangle(0, 0, Width, Height);
            var          _with3 = G;

            _with3.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
            _with3.SmoothingMode     = SmoothingMode.HighQuality;
            _with3.PixelOffsetMode   = PixelOffsetMode.HighQuality;
            _with3.Clear(BackColor);
            TB.BackColor = Color.FromArgb(42, 42, 42);
            TB.ForeColor = Color.FromArgb(255, 255, 255);
            GP           = DrawHelpers.RoundRectangle(Base, 6);
            _with3.FillPath(new SolidBrush(Color.FromArgb(42, 42, 42)), GP);
            _with3.DrawPath(new Pen(new SolidBrush(Color.FromArgb(35, 35, 35)), 2), GP);
            GP.Dispose();
            _with3.FillPie(new SolidBrush(Parent.FindForm().BackColor), new Rectangle(Width - 25, Height - 23, Height + 25, Height + 25), 180, 90);
            _with3.DrawPie(new Pen(Color.FromArgb(35, 35, 35), 2), new Rectangle(Width - 25, Height - 23, Height + 25, Height + 25), 180, 90);
            _with3.InterpolationMode = (InterpolationMode)7;
        }