FillRect
doesn't paint the complete TStringGrid
cell in Delphi XE2. There is a gap of 3 pixels on the left side in the default color (with BiDiMode
set to bdLeftToRight
). This problem doesn't exist in Delphi 6 which I used before.
procedure TShapeline.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
Stringgrid1.Canvas.Brush.Color:=$00FF80FF;
StringGrid1.Canvas.FillRect(Rect);
end;
I tried to change all properties (including the DrawingStyle
) and different brush styles, the painted rectangle doesn't fill the complete cell.
You can use the
StringGrid1.CellRect(ACol, ARow)
that returns the actual TRect of the cell instead of using the parameterRect
.