在Inno Setup中更改任务列表框和其他控件的背景颜色 [英] Changing background color of task list box and other controls in Inno Setup
问题描述
在Inno设置中,我试图将设置的颜色更改为白色.问题是,当我尝试通过Unicode版本的安装程序执行此操作时,在 Select Additional Task Screen (选择其他任务屏幕)中,我得到了灰色部分(下面的屏幕截图).重要的是,当我移至下一个屏幕并再次返回该屏幕时,该灰色部分消失了.
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.
我正在使用基于 Inno Setup:如何更改背景颜色的以下代码.
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;
推荐答案
当颜色改变时,清单框似乎并没有完全重新绘制.
It seems that the checklist box does not repaint completely, when the color changes.
但是实际上您的代码太复杂了(实际上甚至不正确).您可以直接在 InitializeWizard
中设置所有组件的颜色>,而不是CurPageChanged
.这样,列表框在第一次绘制时便具有正确的颜色.
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;
请注意,Inno Setup 6具有现代的向导样式:
Note that Inno Setup 6 has modern wizard style:
[Setup]
WizardStyle=modern
它看起来像这样:
这篇关于在Inno Setup中更改任务列表框和其他控件的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!