public override void InternalRender(RenderContext context) { var bounds = ActualBounds; RenderSelection(context); base.InternalRender(context); if (!ShowGridLines) { return; } int i; for (i = 0; i < _gridLinesX.Count; ++i) { var x = _gridLinesX[i] + bounds.Left; context.FillRectangle(new Rectangle(x, bounds.Top, 1, bounds.Height), GridLinesColor); } for (i = 0; i < _gridLinesY.Count; ++i) { var y = _gridLinesY[i] + bounds.Top; context.FillRectangle(new Rectangle(bounds.Left, y, bounds.Width, 1), GridLinesColor); } }