如何让Inno Setup RunList检查列表框透明?

问题描述 投票:2回答:1

我的安装程序有一个自定义的完成页,上面有一个图像。我参考了这个 在Inno Setup中自定义欢迎和完成页面,并拉伸图片。 的解决方案。但问题是在完成页的复选框,它是在完成页图片上面来的,背景是白色的。如果我把 postinstall 标志,那么它将自动启动我的应用程序。但是我希望用户能够像复选框一样进行选择。那么有什么办法可以让我的图片上面的复选框启动信息透明化呢?能否 TNewCheckBox 这里的帮助?

[Run]
Filename: "app\My program.exe"; Description: "{cm:LaunchProgram}"; #
    Flags: nowait postinstall skipifsilent
installer inno-setup pascalscript
1个回答
1
投票

在标准的Inno Setup中,我不认为你可以使... WizardForm.RunList (TNewCheckListBox)透明。但由于简单的 TNewCheckListBox 是透明的,你可以把 WizardForm.RunListTNewCheckListBox.

[Code]
procedure RunCheckBoxClick(Sender: TObject);
begin
  WizardForm.RunList.Checked[0] := TNewCheckBox(Sender).Checked;
end;

procedure CurPageChanged(CurPageID: Integer);
var
  RunCheckBox: TNewCheckBox;
begin
  if CurPageID = wpFinished then
  begin
    if (not WizardForm.RunList.Visible) or
       (WizardForm.RunList.Items.Count < 1) then
    begin
      Log('No items to run');
    end
      else
    if WizardForm.RunList.Items.Count > 1 then
    begin
      Log('More than one item to run, keeping the standard non-transparent run list');
    end
      else
    begin
      Log('Replacing the one item in the run list with a simple transparent checkbox');
      RunCheckBox := TNewCheckBox.Create(WizardForm);
      RunCheckBox.Parent := WizardForm.RunList.Parent;
      RunCheckBox.Left := WizardForm.RunList.Left + ScaleX(4);
      RunCheckBox.Top := WizardForm.RunList.Top + ScaleY(4);
      RunCheckBox.Width := WizardForm.RunList.Width;
      RunCheckBox.Height := ScaleY(RunCheckBox.Height);
      RunCheckBox.Checked := WizardForm.RunList.Checked[0];
      RunCheckBox.Caption := WizardForm.RunList.ItemCaption[0];
      RunCheckBox.OnClick := @RunCheckBoxClick;
      WizardForm.RunList.Visible := False;
    end
  end; 
end;

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.