如何更改 TStringGrid 网格线的颜色?

How to change the color of TStringGrid grid-lines?

我刚刚完成从 D7 到 XE2 的迁移,我注意到默认的网格线非常微弱(我喜欢将显示器的对比度设置为高,这无济于事),因为您可以在下面的屏幕截图中看到:

这是我尝试通过设置 TStringGridOnDrawCell 事件来将线条重新着色为更暗的颜色:

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;

但这会产生更不理想的结果,特别注意活动单元格的边框:

有什么方法可以使这些网格线变暗或变粗,而且不像我尝试的那样难看吗?

根据 this 问题的答案,我只是将 TStringGridDrawingStyle 属性 设置为 gdsClassic