Is there a way to load the content of a file to TAdvMemo not using the AcceptFile drag and drop option?
问问题
663 次
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 回答