我正在尝试将 InfoBefore 文本文件的文本存储到一个变量中,然后使用自定义字体颜色和背景色将其加载到 RTFEditor 中。
当我尝试从变量加载文本时,它显示“只写属性”
我需要一个明确的例子来说明如何一起做这两件事(将文本存储在 var 中,使用自定义颜色和背景色加载 RTF 中的文本)而不会使事情过于复杂,因为我不知道 Pascal。
这是代码:
const
FontColor: AnsiString = 'cf0';
BackColor: AnsiString = 'cf1'
var
OldText: AnsiString;
procedure InitializeWizard();
begin
// I try to store the text in a variable
Oldtext := WizardForm.InfoBeforeMemo.RTFText;
// I try to load from the variable, with a new font color for ALL the text, and a new BackColor.
WizardForm.InfoBeforeMemo.RTFText := Oldtext + FontColor
end;