protected virtual void DrawHover(Rectangle rectCell, PaintEventArgs e) { Color color = PaintHelper.AdjustColor(SystemColors.Highlight, 40, 50, 85, 90); PaintHelper.DrawHoverBackgroundFlat(e.Graphics, rectCell, color); //LinearGradientBrush brush = new LinearGradientBrush(rectCell, PT.GetLightColor(SystemColors.Highlight), SystemColors.Highlight, 90.0f); //e.Graphics.FillRectangle(brush, rectCell); //e.Graphics.DrawRectangle(SystemPens.Highlight, rectCell.X, rectCell.Y, rectCell.Width - 1, rectCell.Height - 1); }
protected override void OnDrawItem(DrawItemEventArgs e) { if (e.Index < 0 || e.Index >= Items.Count) { base.OnDrawItem(e); return; } e.DrawBackground(); Rectangle rect = GetItemRectangle(e.Index); Brush brushFore; if ((e.State & DrawItemState.Selected) == DrawItemState.Selected) { //Color color = PaintHelper.AdjustColor(SystemColors.Highlight, 40, 50, 85, 90); //SystemColors.Highlight; //LinearGradientBrush brushBack = new LinearGradientBrush(rect, PT.GetLightColor(color, .2), color, 90.0f); //e.Graphics.FillRectangle(brushBack, rect.Left, rect.Top, rect.Width, rect.Height); PaintHelper.DrawHoverBackgroundFlat(e.Graphics, rect, UITheme.Default.Colors.Sharp); brushFore = new SolidBrush(UITheme.Default.Colors.SharpText); //brushFore = Brushes.Black; } else { //e.Graphics.FillRectangle(new LinearGradientBrush(rect, Color.White, Color.GhostWhite, 90.0f) // , rect.Left, rect.Top, rect.Width, rect.Height); //e.Graphics.DrawLine(new Pen(Color.FromArgb(100, Color.Silver)), rect.Left, rect.Bottom - 1, rect.Right, rect.Bottom - 1); brushFore = Brushes.Black; } e.Graphics.DrawLine(new Pen(Color.FromArgb(100, Color.Silver)), rect.Left, rect.Bottom - 1, rect.Right, rect.Bottom - 1); object obj = Items[e.Index]; if (obj != null) { rect.Inflate(-1, -1); StringFormat sf = PaintHelper.SFLeft; sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.None; e.Graphics.DrawString(obj.ToString(), Font, brushFore, rect, sf); } }
protected virtual void DrawSelection(Rectangle rectCell, PaintEventArgs e) { //Rectangle rect1 = rectCell; //rect1.Inflate(2, 2); //LinearGradientBrush brush = new LinearGradientBrush( // rect1, // Color.FromArgb(50, SystemColors.Highlight), // Color.FromArgb(100, SystemColors.Highlight), // 45.0f); //e.Graphics.FillRectangle(brush, rectCell); Color color = PaintHelper.AdjustColor(SystemColors.Highlight, 40, 50, 85, 90); PaintHelper.DrawHoverBackgroundFlat(e.Graphics, rectCell, color); //e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(100, SystemColors.Highlight)), rectCell); //rectCell.Width--; //rectCell.Height--; //e.Graphics.DrawRectangle(SystemPens.Highlight, rectCell); }