FillRect不会TStringGrid在Delphi XE2中绘制完整的单元格.默认颜色左侧有3个像素的间隙(BiDiMode设置为bdLeftToRight).在我之前使用过的Delphi 6中不存在这个问题.
procedure TShapeline.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
Stringgrid1.Canvas.Brush.Color:=$00FF80FF;
StringGrid1.Canvas.FillRect(Rect);
end;
Run Code Online (Sandbox Code Playgroud)
我试图更改所有属性(包括DrawingStyle)和不同的画笔样式,绘制的矩形不会填充整个单元格.