H hbynjl Unregistered / Unconfirmed GUEST, unregistred user! 2008-04-18 #1 用dbgrid如何能够实现根据输入的内容多少自动换行,并在显示时也根据字段的大小自动换行
O ortega Unregistered / Unconfirmed GUEST, unregistred user! 2008-04-18 #2 这是我用于stringgrid中代码,换行不成问题 procedure TForm1.SGDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); begin DrawText(SG.Canvas.Handle, pchar(sg.Cells[Acol,Arow]), Length(sg.Cells[Acol,Arow]), Rect, DT_WORDBREAK or DT_LEFT); end;
这是我用于stringgrid中代码,换行不成问题 procedure TForm1.SGDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); begin DrawText(SG.Canvas.Handle, pchar(sg.Cells[Acol,Arow]), Length(sg.Cells[Acol,Arow]), Rect, DT_WORDBREAK or DT_LEFT); end;
R ruohan Unregistered / Unconfirmed GUEST, unregistred user! 2008-04-18 #3 这个问题你应该从数据集入手,网格只是用来显示的,而数据是在数据集里