我試圖將InfoBefore文本文件的文本存儲到變量中,然後使用自定義字體顏色和背景將其加載到RTFEditor中。InnoSetup,如何將自定義文本加載到RTFText
當我嘗試加載從變量它說文「只寫屬性」
我需要如何這兩件事一起做一個明顯的例子(存儲在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;
TRichEditViewer類沒有RTFText屬性的讀訪問權限,所以沒有Windows API,沒有辦法從那裏讀取RTF文本。所以實際上沒有*沒有複雜的事情*。 – TLama 2013-04-20 19:02:51
更具體地說,TRichEditViewer控件的RTF讀取實現與['EM_STREAMOUT'](http://msdn.microsoft.com/en-us/library/windows/desktop/bb774304(v = vs.85) ).aspx)消息和它的['EditStreamCallback'](http://msdn.microsoft.com/en-us/library/windows/desktop/bb774368(v = vs.85).aspx)回調函數,你需要通過一些['external library'](http://www.sherlocksoftware.org/page.php?id=54)來包裝。 – TLama 2013-04-21 10:19:49
omg ...似乎非常辛苦,謝謝你的信息傢伙。任何其他方式將InfoBeforeFile存儲在var中? – ElektroStudios 2013-04-21 11:13:06