开发者

why memo.loadFromFile takes so long time?

I use TMemo to display long strings. I was very surprised that method : Memo1.loadfromfile('mem.txt') [mem.txt = 111 kB] took about 35 seconds, what is really really long time.

How can I make TMemo load str开发者_运维知识库ings in real time?

thanx


Because WordWrap property was true...


:-) And you can try

try
  Memo1.Lines.BeginUpdate;
  Memo1.LoadFromFile('mem.txt');
finally
  Memo1.Lines.EndUpdate;
end;


You did not say which version of Delphi you are using. In Delphi 2009 and later, TStrings is now Unicode aware, and thus has to perform additional processing when non-Unicode (Ansi/UTF) encoded files are being loaded.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜