3

I have a input file wizard page where I select a file and proceed with the next page. The code is as follows.

[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;

Is there a way to change the font color or style (bold, italic) for the line "Font color or style change required..." in the wizard page?

Thanks in advance!

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
DeeJay007
  • 469
  • 4
  • 30
  • 1
    Related: https://stackoverflow.com/questions/35311258/skinned-innosetup-showing-text-instead-of-scrollbar – Andrew Truckle Mar 23 '18 at 11:10
  • Am not using any skin apps currently. I have modified the text color and style in Custom pages. Thought there might be a way to do so in my current page as well. – DeeJay007 Mar 23 '18 at 11:14
  • I don't even know how to do that! MAybe @martin-prikryl can help with this. – Andrew Truckle Mar 23 '18 at 11:20
  • 1
    `[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 – DeeJay007 Mar 23 '18 at 11:34
  • I see. You can set the properties at design time. Not sure you can do these adjustments to predefined custom pages. – Andrew Truckle Mar 23 '18 at 11:36

1 Answers1

4

Use TInputFileWizardPage.PromptLabels to access the TNewStaticText instance that represents the label:

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

enter image description here

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992