Inno Setup-更改PageNameLabel / PageDescriptionLabel字体参数(颜色,大小)

扬斯基

所以我在我的.iss文件中得到了这个:

[Files]
Source: "WizModernImageTop2.bmp"; Flags: dontcopy

[Code]

function CloneStaticTextToLabel(StaticText: TNewStaticText): TLabel;
begin
  Result := TLabel.Create(WizardForm);
  Result.Parent := StaticText.Parent;
  Result.Left := StaticText.Left;
  Result.Top := StaticText.Top;
  Result.Width := StaticText.Width;
  Result.Height := StaticText.Height;
  Result.AutoSize := StaticText.AutoSize;
  Result.ShowAccelChar := StaticText.ShowAccelChar;
  Result.WordWrap := StaticText.WordWrap;
  Result.Font := StaticText.Font;
  StaticText.Visible := False;
  WizardForm.PageDescriptionLabel.Font.Color := clRed;
  WizardForm.PageNameLabel.Font.Color := clRed;
end;

var
  PageDescriptionLabel: TLabel;
  PageNameLabel: TLabel;

procedure InitializeWizard;
var
  BitmapImage: TBitmapImage;
begin
  ExtractTemporaryFile('WizModernImageTop2.bmp');
  BitmapImage := TBitmapImage.Create(WizardForm);
  BitmapImage.Parent := WizardForm.MainPanel;
  BitmapImage.Width := WizardForm.MainPanel.Width;
  BitmapImage.Height := WizardForm.MainPanel.Height;
  BitmapImage.Stretch := True;
  BitmapImage.AutoSize := False;
  BitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizModernImageTop2.bmp'));
  WizardForm.WizardSmallBitmapImage.Visible := True;
  WizardForm.PageDescriptionLabel.Visible := True;
  WizardForm.PageNameLabel.Visible := True;


  { Create TLabel equivalent of standard TNewStaticText components }
  PageNameLabel := CloneStaticTextToLabel(WizardForm.PageNameLabel);
  PageDescriptionLabel := CloneStaticTextToLabel(WizardForm.PageDescriptionLabel);
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  { Update the custom TLabel components from the standard hidden components }
  PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
  PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
end;

我要实现的目标:

将PageNameLabel和PageDescriptionLabel的颜色/大小更改为白色,以使其可见。现在黑底黑字。我不知道WizardForm元素的字体参数,是...

更新:如果有人要在其安装程序中使用图像,而不是在右侧显示小WizardSmallImage图标,请使用上面提供的代码,这样可以使标签显示在图像顶部并启用透明度。它需要Inno的Unicode版本才能工作。

马丁·普里克里(Martin Prikryl)

使用TNewStaticText.Font.Color更改标签颜色。

WizardForm.PageDescriptionLabel.Font.Color := clWhite;
WizardForm.PageNameLabel.Font.Color := clWhite;

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Inno Setup如何更改TInputFileWizardPage上的字体颜色或标签样式

Inno Setup更改Small Wizard图像的位置和大小

Inno Setup更改c:\权限

找出Inno Setup WizardForm标题的字体大小,字体名称和字体颜色,并将WizardForm标题居中

Inno Setup根据所选组件更改AppName

如何在Inno Setup中更改SelectDirBitmapImage和SelectGroupBitmapImage的背景颜色

在Inno Setup中更改任务列表框和其他控件的背景颜色

提供Inno Setup下载功能的文件大小

在Inno Setup中将{AppVersion}用作函数的参数

Inno Setup,检测参数文件是否存在?

Inno Setup,[运行]中参数中的空格

如何将LoadStringFromFile函数从Inno Setup 5更改为Inno Setup 6并使其工作

使用Inno Setup安装字体-替换锁定的字体

Inno Setup:如何根据代码更改语言文件

如何更改 Inno Setup 窗口标题中的名称?

Inno setup - 如何在设置悬停中更改版本?

更改 Inno Setup 啟動時的焦點控制

Inno Setup:如何更改卸载背景色

用户输入后 Inno Setup 向导更改页面

安装字体后,Inno Setup是否需要重新启动?

使用Inno Setup将字体安装到PC

Inno Setup:模式窗口和浏览目录窗口的颜色

Inno Setup卸载文件的大小已急剧增加

将Inno Setup MainPanel调整为横幅图像大小

Inno Setup tmp被阻止

如何在Inno Setup中使用PrepareToTinstall函数的NeedsRestart参数?

IsDotNetInstalled Inno Setup函数中的`MinServicePack`参数是什么

带有参数和屏幕截图的Inno Setup页面列表

Inno setup将命令行参数传递给#define