1

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

4

1 回答 1

1

大多数基于 VCL 的备忘录控件(包括第三方的)都有一个Lines.LoadFromFile或类似的东西。

根据 TMS 的网站TAdvMemo有一个Lines属性,应该是TStrings后代,因此应该支持LoadFromFile。(请参阅我链接到的常见问题解答页面,特别是有关查看文本是否为空的问题 - 它使用该Lines属性。)

所以它应该像(Delphi代码)一样简单:

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

因此,在 C++ Builder 中,它应该类似于:

AdvMemo1->Lines->LoadFromFile("C:\\Temp\\YourFile.txt");
于 2012-01-30T21:03:40.713 回答