public override void OnPaint(RGDrawingContext dc) { int value = 0; int.TryParse(dc.Cell.Display, out value); if (value > 0) { Graphics g = dc.Graphics; Rectangle rect = new Rectangle(Bounds.Left, Bounds.Top + 1, (int)(Math.Round(Bounds.Width / 100f * value)), Bounds.Height - 1); using (LinearGradientBrush lgb = new LinearGradientBrush(rect, Color.Coral, Color.IndianRed, 90f)) { g.PixelOffsetMode = PixelOffsetMode.Half; g.FillRectangle(lgb, rect); g.PixelOffsetMode = PixelOffsetMode.Default; } } }
public override void OnPaint(RGDrawingContext dc) { // try getting the cell value int value = 0; int.TryParse(dc.Cell.Display, out value); // retrieve graphics object var g = dc.Graphics; int halfHeight = Bounds.Height / 2; int sliderHeight = Math.Min(Bounds.Height - 4, 20); // draw slide bar g.FillRectangle(Brushes.Gainsboro, 4, halfHeight - 3, Bounds.Width - 8, 6); int x = 2 + (int)Math.Round(value / 100f * (Bounds.Width - 12)); // thumb rectangle Rectangle rect = new Rectangle(x, halfHeight - sliderHeight / 2, 8, sliderHeight); // draw slide thumb g.FillRectangle(IsHover ? Brushes.LimeGreen : Brushes.LightGreen, rect); }
public override void OnPaint(RGDrawingContext dc) { if (focused) { Rectangle btnRect = new Rectangle(Bounds.Right + 1, Bounds.Top + (Bounds.Height - ButtonHeight) / 2, ButtonWidth, ButtonHeight); ControlPaint.DrawComboButton(dc.Graphics, btnRect, ButtonState.Normal); } }
public override void OnPaint(RGDrawingContext dc) { dc.Graphics.DrawEllipse(Pens.Blue, base.Bounds); }
public override void OnPaint(RGDrawingContext dc) { dc.Graphics.FillRectangle(Brushes.SkyBlue, new Rectangle(offset, 0, ThumbSize, Bounds.Height)); // call core text draw dc.DrawCellText(); }
public override void OnPaint(RGDrawingContext dc) { lock (Gif) dc.Graphics.DrawImage(Gif, Bounds); // call core text draw dc.DrawCellText(); }
public override void OnPaint(RGDrawingContext dc) { using (var b = new SolidBrush(Color.FromArgb(alpha, Color.Orange))) { dc.Graphics.FillRectangle(b, Bounds); } // call core text draw dc.DrawCellText(); }
public override void OnPaint(RGDrawingContext dc) { if (Image != null) { dc.Graphics.DrawImage(Image, Bounds); } dc.DrawCellText(); }
public override void OnPaint(RGDrawingContext dc) { // call core draw text method dc.DrawCellText(); ControlPaint.DrawComboButton(dc.Graphics, dropdownButtonRect, IsDropdown ? ButtonState.Pushed : ButtonState.Normal); }
public override void OnPaint(RGDrawingContext dc) { ControlPaint.DrawCheckBox(dc.Graphics, CheckRect, ButtonState); }
public override void OnPaint(RGDrawingContext dc) { // draw background ControlPaint.DrawButton(dc.Graphics, Bounds, IsPressed ? ButtonState.Pushed : ButtonState.Normal); // get style var style = dc.Cell.Style; var textColor = style.TextColor; // call core text drawing method dc.DrawCellText(); }