2
votes

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 strings in real time?

thanx

3

3 Answers

4
votes

Because WordWrap property was true...

1
votes

:-) And you can try

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

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.