Changing background color of task list box and other controls in Inno Setup

不问归期 提交于 2019-12-08 01:57:45

问题


In Inno Setup, I am trying to change the color of the setup to white. The problem is that when I try to do it by the Unicode version of installer, in the Select Additional Task Screen, I am getting grey section (screenshot is below). The important part is that when I move to next screen and comes back to that screen again, that grey section is gone.

I am using following code, based on Inno Setup: How to change background color.

procedure CurPageChanged(CurPageID: Integer);
begin
  case CurPageID of
    wpWelcome: WizardForm.Color := WizardForm.WelcomePage.Color;
    wpFinished: WizardForm.Color := WizardForm.FinishedPage.Color;
    wpLicense: WizardForm.InnerPage.Color := clWhite;
    wpSelectDir: WizardForm.InnerPage.Color := clWhite;
    wpSelectTasks: WizardForm.TasksList.Color := clWhite;
    wpReady: WizardForm.ReadyMemo.Color := clWhite
  else
    WizardForm.Color := clWhite;
  end;
end;

回答1:


It seems that the checklist box does not repaint completely, when the color changes.

But actually your code is too complicated (and actually not even correct). You can set the color of all components directly in InitializeWizard, instead of CurPageChanged. This way, the list box has the correct color, when painted for the first time already.

procedure InitializeWizard();
begin
  WizardForm.Color := clWhite;
  WizardForm.InnerPage.Color := WizardForm.Color;
  WizardForm.TasksList.Color := WizardForm.Color; 
  WizardForm.ReadyMemo.Color := WizardForm.Color;
end;


Note that Inno Setup 6 has modern wizard style:

[Setup]
WizardStyle=modern

It looks like this:



来源:https://stackoverflow.com/questions/52441557/changing-background-color-of-task-list-box-and-other-controls-in-inno-setup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!