//参考如下代码
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
var
  vText: PChar;
begin
  with TStringGrid(Sender) do begin
    vText := PChar(Cells[ACol, ARow]);
    Canvas.FillRect(Rect);
    DrawText(Canvas.Handle, vText, StrLen(vText), Rect,
      DT_CENTER or DT_VCENTER or DT_SINGLELINE); //<<--
    { TODO : 修改对齐方式 }
    if gdFocused in State then begin
      Rect.Left := Rect.Left + 1;
      Rect.Top := Rect.Top + 1;
      Rect.Right := Rect.Right - 1;
      Rect.Bottom := Rect.Bottom - 1;
      Canvas.DrawFocusRect(Rect);
    end;
  end;
end;