I've just finished migrating from D7 to XE2 and I've noticed that the default grid-lines are extremely faint (it doesn't help that I like to set the contrast on my monitor to high), as you can see in the screenshot below:
This was my attempt to re-color the lines darker by setting the TStringGrid
's OnDrawCell
event:
procedure TfrmBaseRamEditor.DrawStrGrid(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
sgrSenden.Canvas.Pen.Color := clDkGray;
// "Set the Style property to bsClear to eliminate flicker when the object
// repaints" (I don't know if this helps).
sgrSenden.Canvas.Brush.Style := bsClear;
// Draw a line from the cell's top-right to its bottom-right:
sgrSenden.Canvas.MoveTo(Rect.Right, Rect.Top);
sgrSenden.Canvas.LineTo(Rect.Right, Rect.Bottom);
// Make the horizontal line.
sgrSenden.Canvas.LineTo(Rect.Left, Rect.Bottom);
// The other vertical line.
sgrSenden.Canvas.LineTo(Rect.Left, Rect.Top);
end;
But this produces a result even less desirable, notice especially the border of the active cell:
Is there any way to make these grid-lines darker or thicker in a way that doesn't look as ugly as my attempt?
As per the answer to this question, I simply set DrawingStyle
property of the TStringGrid
to gdsClassic
.