문제

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

도움이 되었습니까?

해결책

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");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top