TMemo最大宽度 [英] TMemo max width
本文介绍了TMemo最大宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法使TMemo显示长度超过1024的文字到1行?
看看这个简单的代码:
Is there any way to make TMemo display text longer than 1024 into 1 line?
Take a look this simple code:
procedure TForm1.Button2Click(Sender: TObject);
var
s: string;
i: integer;
begin
s := '';
for i := 0 to 10000 do
s := s + 'a';
Memo1.Clear;
Memo1.Lines.Add(s);
end;
长文本s将以多行显示。 Memo1将自动将文本换成1024个字符。
The long text "s" will be displayed in multiple lines. The Memo1 will automatically wrap the text after 1024 characters.
推荐答案
TMemo是本机多行编辑控件的包装器,受其限制。从 INFO:多行编辑控件的大小限制:
A TMemo is a wrapper for a native multi line edit control and is subject to the limitations it has. From INFO: Size Limits for a Multiline Edit Control:
多行编辑控件也受到以下限制:
A multiline edit control is also subject to the following limitations:
- 单行中的最大字符数是1024。
- 一行的最大宽度为30,000像素。
- 最大行数约为16,350。
这篇关于TMemo最大宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文