Delphi中QRDBText如何用代码控制换行?

ENIAC1946 2003-12-25 03:45:59
各位:

  Delphi中QRDBText如何用代码控制换行?
...全文
47 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
happyhong 2004-01-02
  • 打赏
  • 举报
回复
楼上说得太麻烦了
konhon 2003-12-25
  • 打赏
  • 举报
回复
如果是英文的话,把AutoSize设置为False,AuotStretch及WrapText设置True 就可以啦。
是中文的话,要在字符中添加一些空格才行。

建议用QrMemo和Memo控件来实现换行。

procedure lineBreakQRMemo(text: string; const textMemo: TMemo; const QRMemo: TQRMemo);
var
i: integer;
begin
textMemo.Width := QRMemo.Width;
textMemo.Height := QRMemo.Height;
textMemo.Font.Name := QRMemo.Font.Name;
textMemo.Font.Size := QRMemo.Font.Size;
textMemo.Text := text;
QRMemo.Lines.Clear;
for i := 0 to textMemo.Lines.Count - 1 do
QRMemo.Lines.Add(textMemo.Lines.Strings[i]);
end;

5,390

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧