How to make text Bold in TNewStaticText in inno se

2019-04-15 23:23发布

问题:

i want to get the text in TNewStaticText bold . is there any method available in inno setup

回答1:

The bold text you can have if you include the fsBold style to the Font.Style property of your static text control, for instance:

[Code]
procedure InitializeWizard;
var
  StaticText: TNewStaticText;
begin
  StaticText := TNewStaticText.Create(WizardForm);
  StaticText.Parent := WizardForm;
  StaticText.Left := 0;
  StaticText.Top := WizardForm.NextButton.Top;
  StaticText.Font.Style := [fsBold];
  StaticText.Caption := 'This is a bold text';
end;

Just out of curiosity, there are also other font styles that you can include to the Font.Style property. Here is the list of all the available styles:

  • fsBold - the font is boldfaced
  • fsItalic - the font is italicized
  • fsUnderline - the font is underlined
  • fsStrikeOut - the font is displayed with a horizontal line through it

These styles you can combine however you want, so for instance to make a bold underlined text control, you can set your Font.Style property this way:

StaticText.Font.Style := [fsBold, fsUnderline];


标签: inno-setup