Loading File to TAdvMemo

701 views Asked by At

Is there a way to load the content of a file to TAdvMemo not using the AcceptFile drag and drop option?

1

There are 1 answers

0
Ken White On BEST ANSWER

Most VCL-based memo controls (including third-party ones) have a Lines.LoadFromFile or something similar.

According to TMS's website, TAdvMemo has a Lines property, which should be a TStrings descendant and therefore should support LoadFromFile. (See the FAQ page I linked to, specifically the question about seeing if the text is empty - it uses the Lines property.)

So it should be as easy as (Delphi code):

AdvMemo1.Lines.LoadFromFile('C:\Temp\YourFile.txt');

So, in C++ Builder it should be something like:

AdvMemo1->Lines->LoadFromFile("C:\\Temp\\YourFile.txt");