procedure TFormSetParameter.GridDrawCell(Sender: TObject
ACol,
ARow: Integer
Rect: TRect
State: TGridDrawState);
begin
{文字居中}
with Sender as TStringGrid do
begin
Canvas.FillRect(Rect);
DrawText(Canvas.Handle, PChar(Cells[ACol, ARow]), Length(Cells[ACol, ARow]), Rect, DT_CENTER or DT_SINGLELINE or DT_VCENTER);
end;
{文字居中结束}
end;
只能用方法来实现!左右,你可以查查DT_Center几个相关的东西,就可以了