Exemple #1
0
        protected override void OnPaintBackground(PaintEventArgs e)
        {
            if (!SystemInformation.HighContrast)
            {
                Rectangle fadeRect = new Rectangle(0, tableLayoutPanel1.Top + 1, ClientSize.Width, imgBg.Height);
                GraphicsHelper.TileFillUnscaledImageHorizontally(e.Graphics, imgBg, fadeRect);
                using (Brush b = new SolidBrush(new HCColor(229, 238, 248, SystemColors.Window)))
                    e.Graphics.FillRectangle(b, 0, fadeRect.Bottom, ClientSize.Width, ClientSize.Height - fadeRect.Bottom);
            }
            else
            {
                e.Graphics.Clear(SystemColors.Window);
            }

            HCColor startColor = new HCColor(0xA5A5A5, SystemColors.WindowFrame);
            HCColor endColor   = new HCColor(0xC1CEDE, SystemColors.WindowFrame);

            if (BidiHelper.IsRightToLeft)
            {
                Swap(ref startColor, ref endColor);
            }

            const int GRADIENT_WIDTH = 350;
            int       gradientStart  = !BidiHelper.IsRightToLeft ? flowLayoutPanel.Right : flowLayoutPanel.Left - GRADIENT_WIDTH;
            int       gradientEnd    = !BidiHelper.IsRightToLeft ? flowLayoutPanel.Right + GRADIENT_WIDTH : flowLayoutPanel.Left;

            DrawGradientLine(e.Graphics, startColor, endColor, 0, tableLayoutPanel1.Top, ClientSize.Width, gradientStart, gradientEnd);
        }
Exemple #2
0
        protected override void OnPaint(PaintEventArgs pe)
        {
            Color bgColor, borderColor, textColor;
            Color lineColor = new HCColor(0xA5A5A5, SystemColors.ControlDarkDark);

            if (Selected)
            {
                bgColor     = new HCColor(Color.White, SystemColors.Control);
                textColor   = new HCColor(0x333333, SystemColors.ControlText);
                borderColor = new HCColor(0xA5A5A5, SystemColors.ControlDarkDark);
            }
            else
            {
                bgColor     = new HCColor(0xF7F7F7, SystemColors.Control);
                textColor   = new HCColor(0x6E6E6E, SystemColors.ControlText);
                borderColor = new HCColor(0xC9C9C9, SystemColors.ControlDark);
            }

            BidiGraphics g = new BidiGraphics(pe.Graphics, ClientRectangle);

            DrawTabFace(g, bgColor, borderColor, lineColor);
            DrawTabContents(g, textColor);
        }