Question

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

Was it helpful?

Solution

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");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top