Make an installer with text that is formatted (Partially Bold) in Inno Setup?

て烟熏妆下的殇ゞ 提交于 2019-12-04 23:56:00

问题


Anyone saw GOG.com game installer? How to make welcome text string like there including Path and Need Size in a single Caption? Where part of is bolded.

Here are examples of how changes String line breaking after modifying install path


回答1:


You can use a TRichEditViewer setting the RFTText property and the UseRichEdit to True.

Try this sample

procedure CreateCustomPages;
var
  Page                 : TWizardPage;
  rtfHelpText          : TRichEditViewer;
  s: string;
begin
 Page := CreateCustomPage(wpWelcome, 'Custom wizard page controls', 'Bold Demo');
 Page.Surface.Align:=alCLient;

 s:='{\rtf1\ansi\ansicpg1252\deff0\deflang13322{\fonttbl{\f0\fnil\fcharset0 Tahoma;}}'+
    '\viewkind4\uc1\pard\f0\fs16 This is a normal text, \b and this is a bold text\b0\par}';

 rtfHelpText := TRichEditViewer.Create(Page);
 rtfHelpText.Parent := Page.Surface;
 rtfHelpText.Left :=    0;
 rtfHelpText.Top := 0;
 rtfHelpText.Width := Page.SurfaceWidth;
 rtfHelpText.Height := Page.SurfaceHeight;
 rtfHelpText.Scrollbars := ssVertical;
 rtfHelpText.ReadOnly := True;
 rtfHelpText.UseRichEdit := True;
 rtfHelpText.RTFText := s;
end;

procedure InitializeWizard();
begin
  CreateCustomPages();
end;



来源:https://stackoverflow.com/questions/9068841/make-an-installer-with-text-that-is-formatted-partially-bold-in-inno-setup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!