解决方法
PageNameLabel和PageDescriptionLabel是TNewStaticText组件.此组件不支持透明度.虽然具有类似功能的TLabel组件确实支持透明度(
in Unicode version of Inno Setup only).
因此,您可以使用TLabel等效替换这两个组件.然后,您需要确保每当Inno Setup更新原始组件时,您的新自定义组件的标题都会更新.对于这两个组件,这非常简单,因为它们仅在页面更改时才更新.因此,您可以从CurPageChanged
event function更新自定义组件.
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;
更简单的方法是更改原始标签背景颜色:
Inno Setup – Change size of page name and description labels