procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
with TStringGrid(Sender) do
begin
if Cells[ACol, ARow] > '' then
begin
Canvas.Brush.Color := clMoneyGreen; Canvas.FillRect(Rect)
end;
Canvas.TextRect(Rect,(Rect.Right+Rect.Left-Canvas.TextWidth(Cells[ACol,ARow])) shr 1,
Rect.Top + 2, Cells[aCol, aRow])
end
end;