【问题标题】:Inno Setup how to change the font color or style of label on TInputFileWizardPageInno Setup 如何更改 TInputFileWizardPage 上标签的字体颜色或样式
【发布时间】:2018-03-23 11:00:31
【问题描述】:

我有一个输入文件向导页面,我在其中选择一个文件并继续下一页。代码如下。

[Code]
var
    PageFileSelect: TInputFileWizardPage;

function CreateFileSelectPage(): String;
begin
    PageFileSelect := CreateInputFilePage(PagePreviousPage.ID,
        'Select File',
        'Select File Location',
        'Additional comments...');

    PageFileSelect.Add('Font color or style change required...',
        'test.exe',
        '*.exe');

    PageFileSelect.Values[0] := FileLocation;
end;

有没有办法更改向导页面中“需要更改字体颜色或样式...”行的字体颜色或样式(粗体、斜体)?

提前致谢!

【问题讨论】:

  • 我目前没有使用任何皮肤应用程序。我已经修改了自定义页面中的文本颜色和样式。认为在我当前的页面中也可能有一种方法。
  • 我什至不知道该怎么做!也许@martin-prikryl 可以帮助解决这个问题。
  • [Code] var NewStaticText2: TNewStaticText; function CreatePage(PreviousPageId: Integer): Integer; var Page: TWizardPage; begin { NewStaticText2 } NewStaticText2 := TNewStaticText.Create(Page); with NewStaticText2 do begin Parent := Page.Surface; Caption :='Font in Bold'; Width := ScaleX(293); Height := ScaleY(62); AutoSize := False; Font.Color := -16777208; Font.Height := ScaleY(-11); Font.Name := 'Tahoma'; Font.Style := [fsBold]; ParentFont := False; TabOrder := 1; WordWrap := True; end; end;@AndrewTruckle
  • 我明白了。您可以在设计时设置属性。不确定您是否可以对预定义的自定义页面进行这些调整。

标签: inno-setup pascalscript


【解决方案1】:

使用TInputFileWizardPage.PromptLabels 访问代表标签的TNewStaticText 实例:

PageFileSelect.PromptLabels[0].Font.Color := clRed;
PageFileSelect.PromptLabels[0].Font.Style := [fsBold, fsItalic];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-11
    • 2017-12-23
    • 1970-01-01
    相关资源
    最近更新 更多