FillRect不会在Delphi XE2中绘制完整的TStringGrid单元格.默认颜色左侧有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;