2015-02-08 142 views
2

是否可以更改使用CreateOutputMsgMemoPage創建的窗口的實際消息部分顯示的字體?Inno Setup更改CreateOutputMsgMemoPage字體

我需要從數據庫查詢返回一些結果在Inno Setup的一個窗口,我用從文件中讀取這樣做:

LoadStringFromFile(ExpandConstant('{app}\Output.txt'), astrResults); 

,然後創建頁面,如下所示:

ResultsPage := CreateOutputMsgMemoPage(wpInstalling, 
'Results', 'The following results were returned from the database.', 
'', 
astrResults); 

麻煩的是,我正在丟失文本文件中的柱狀製表符分隔格式,因爲文本以寬度可變的字體顯示。因此,我需要使用固定寬度的字體(例如Lucida Console)來保持正確的格式。有沒有辦法做到這一點?

+2

是,'ResultsPage.RichEditViewer.Font.Name:='Lucida Console';'。在這種情況下,您總是可以在['Support Classes Reference'](http://www.jrsoftware.org/ishelp/index.php?topic=scriptclasses),'TOutputMsgMemoWizardPage'類中找到返回對象的類描述,有兩個發佈的成員,其中'RichEditViewer'顯然是內容控制。然後,您只需點擊課程即可查看其成員,直至找到與字體相關的內容。 – TLama 2015-02-08 19:30:19

+0

謝謝,@TLama這個工程很好,並允許我使用'ResultsPage.RichEditViewer.Font.Size:= 9'設置字體大小。如果你添加這個答案我可以接受它。 – 2015-02-08 22:47:20

回答

2

它有可能使用:

ResultsPage.RichEditViewer.Font.Name := 'Lucida Console'; 

改變字體和:

ResultsPage.RichEditViewer.Font.Size := 9; 

改變大小。謝謝@TLama。