Inno Setup-页面名称和描述标签中文本下方的透明度 [英] Inno Setup - Transparency under text in page name and description labels

查看:114
本文介绍了Inno Setup-页面名称和描述标签中文本下方的透明度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在此处的文本下方添加透明度:

I want make transparency under text here:

如您所见,我不想拥有黑色背景.

As you can see, I have black background what i don't want to have.

问候.

推荐答案

PageNameLabelPageDescriptionLabelTNewStaticText组件.该组件不支持透明性.尽管具有相似功能的TLabel组件确实支持透明性(在Unicode版本的Inno Setup中和主题Windows仅).

The PageNameLabel and PageDescriptionLabel are TNewStaticText components. This component does not support transparency. Though TLabel component, which has similar functionality otherwise, does support transparency (in Unicode version of Inno Setup and with themed Windows only).

因此,您可以用等效的TLabel替换这两个组件.然后,当Inno Setup确实更新原始组件时,您需要确保更新新的自定义组件的标题.对于这两个组件,这很容易,因为只有页面更改时它们才会更新.因此,您可以从 CurPageChanged事件函数.

So, you can replace those two components with TLabel equivalent. And then you need to make sure, that captions of your new custom components get updated, whenever Inno Setup does update the original components. For these two components, this is quite easy, as they get updated only, when a page changes. So you can update your custom components from 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设置-更改页面名称和描述标签的大小

Way easier is to change original labels background color:
Inno Setup - Change size of page name and description labels

这篇关于Inno Setup-页面名称和描述标签中文本下方的透明度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆