和PageNameLabel是PageDescriptionLabel组件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 - 更改页面名称和描述标签的大小
| 归档时间: |
|
| 查看次数: |
1554 次 |
| 最近记录: |