Exemplo n.º 1
0
        public static void FillGradientHeaderCellRectangle(Rectangle r, Graphics g, DataGridHeaderCellType ctype)
        {
            if (ctype == DataGridHeaderCellType.Highlight)
            {
                g.FillRectangle(HighlightBrush, r);
                return;
            }
            Color c1, c2;

            if (ctype == DataGridHeaderCellType.Current)
            {
                c1 = Color.FromArgb(220, 240, 255);
                c2 = Color.FromArgb(155, 170, 180);
            }
            else
            {
                c1 = Color.FromArgb(255, 255, 255);
                c2 = Color.FromArgb(200, 200, 200);
            }
            using (var lb1 = new LinearGradientBrush(r, c1, c2, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
            {
                g.FillRectangle(lb1, r);
            }
        }
Exemplo n.º 2
0
 public override void PaintRowNumberBackground(DataGridViewCellPaintingEventArgs e, DataGridHeaderCellType ctype)
 {
     FillGradientHeaderCellRectangle(e.CellBounds, e.Graphics, ctype);
 }
Exemplo n.º 3
0
 public abstract void PaintColumnHeaderBackground(DataGridViewCellPaintingEventArgs e, DataGridHeaderCellType ctype);
Exemplo n.º 4
0
 public override void PaintColumnHeaderBackground(DataGridViewCellPaintingEventArgs e, DataGridHeaderCellType ctype)
 {
     e.PaintBackground(e.CellBounds, false);
 }