Inno Setup - 页面名称和描述标签中文本下的透明度

Dam*_*ent 3 inno-setup

我想在此处的文本下设置透明度:

在此输入图像描述

正如你所看到的,我有黑色背景,这是我不想要的。

问候。

Mar*_*ryl 5

PageNameLabelPageDescriptionLabel组件TNewStaticText。该组件不支持透明度。尽管TLabel组件在其他方面具有类似的功能,但确实支持透明度(仅在 Inno Setup 的 Unicode 版本和主题 Windows 中)。

因此,您可以用等效的组件替换这两个组件TLabel。然后,您需要确保每当 Inno Setup 更新原始组件时,新自定义组件的标题都会更新。对于这两个组件来说,这非常简单,因为它们仅在页面更改时才会更新。因此您可以从CurPageChanged事件函数更新您的自定义组件。

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

var
  PageDescriptionLabel: TLabel;
  PageNameLabel: TLabel;

procedure InitializeWizard();
begin
  { ... }

  { 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;
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述


更简单的方法是更改​​原始标签背景颜色:
Inno Setup - 更改页面名称和描述标签的大小

  • 是的。我安装了 Inno Setup 的 Unicode 版本,一切正常。感谢一切。 (2认同)