gpt4 book ai didi

delphi - TMemo 最大宽度

转载 作者:行者123 更新时间:2023-12-03 15:48:10 32 4
gpt4 key购买 nike

有没有办法让TMemo将长度超过1024的文本显示为1行?
看一下这个简单的代码:

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 个字符后自动换行。

最佳答案

TMemo 是 native 多行编辑控件的包装器,并且受到其限制。来自 INFO: Size Limits for a Multiline Edit Control :

A multiline edit control is also subject to the following limitations:

  • The maximum number of characters in a single line is 1024.
  • The maximum width of a line is 30,000 pixels.
  • The maximum number of lines is approximately 16,350.

关于delphi - TMemo 最大宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27188772/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com