StringGrid cell中文字居中显示
时间:2010-12-07 来源:sunjun0427
procedure TForm1.Stringgrid1DrawCell(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;
相关阅读 更多 +
排行榜 更多 +