Exemplo n.º 1
0
        /// <summary>
        /// Paints the background
        /// </summary>
        /// <param name="pevent">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains information about the control to paint.</param>
        protected override void OnPaintBackground(PaintEventArgs pevent)
        {
            base.OnPaintBackground(pevent);

            PaintingEngine.PaintGlassEffect(pevent.Graphics, BackColor, Width, Height);
            PaintingEngine.PaintGradientBorders(pevent.Graphics, this.sideBorderTopColor, this.sideBorderBottomColor, Width, Height, this.sideBorderWidth, this.sideBorder);

            if (this.pushed)
            {
                PaintingEngine.PaintPushedEffect(pevent.Graphics, Width, Height);
            }
            else if (Enabled && (this.hover || this.timerFade.Enabled))
            {
                PaintingEngine.PaintHoverEffect(
                    pevent.Graphics,
                    Color.FromArgb(12 * this.alphaChannelCoeff, Color.Gainsboro),
                    Color.FromArgb(12 * this.alphaChannelCoeff, Color.Black),
                    Color.FromArgb(10 * this.alphaChannelCoeff, Color.White),
                    Color.FromArgb(5 * this.alphaChannelCoeff, Color.Beige),
                    this.Width,
                    this.Height);
            }

            // Draw a dotted line inside the client rectangle
            if (ShowFocusCues && ContainsFocus)
            {
                Rectangle r = ClientRectangle;
                r.Inflate(-7, -7);
                r.Width--;
                r.Height--;
                Pen p = new Pen(Color.White, 1);
                p.DashStyle = DashStyle.Dot;
                pevent.Graphics.DrawRectangle(p, r);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Paints the background of the control.
 /// </summary>
 /// <param name="pevent">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains information about the control to paint.</param>
 protected override void OnPaintBackground(PaintEventArgs pevent)
 {
     PaintingEngine.PaintGlassEffect(pevent.Graphics, BackColor, Width, Height);
     PaintingEngine.PaintGradientBorders(pevent.Graphics, this.sideBorderTopColor, this.sideBorderBottomColor, Width, Height, this.sideBorderWidth, this.sideBorder);
 }