是否可以在Delphi (xe)中对DBgrid单元格(高度)进行换行?我有一个具有多个列的dbgrid,这些列具有固定的列宽,有些列的列宽高达100个字符,我需要它们在不改变列宽的情况下适合适当的Cell。
你知道怎么做吗?
谢谢。
发布于 2014-12-27 23:30:28
您需要让它成为ownerdraw,并在OnDrawCell事件中放入填充单元格的代码:
procedure TForm4.Grid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
Grid1.Canvas.TextRect(Rect, Rect.Left+1, Rect.Top+1, WrapText(Grid1.Cells[ACol,ARow], 40));
end;
https://stackoverflow.com/questions/27563156
复制相似问题