1
我有問題弄清楚爲什麼我不能在InitializeWizard
操縱任務複選框,但我可以CurPageChanged
:Inno Setup:如何在InitializeWizard中使用WizardForm.TasksList.Items?
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"
Name: "Option1"; Description: "Option1"
[Code]
procedure CurPageChanged(CurPageID: Integer);
var Index: Integer;
begin
if CurPageID = wpSelectTasks then
begin
Index := WizardForm.TasksList.Items.IndexOf('Option1');
if Index <> -1 then
MsgBox('Touch device checkbox found.', mbInformation, MB_OK); { THIS WORKS!! }
end;
end;
procedure InitializeWizard();
var Index: Integer;
begin
Index := WizardForm.TasksList.Items.IndexOf('Option1');
if Index <> -1 then
MsgBox('Touch device checkbox found.', mbInformation, MB_OK); { THIS DOES NOT WORK }
end;
我不能在InitializeWizard
使用WizardForm.TasksList.Items
?我希望能夠撥打WizardForm.TasksList.Checked[Index] := False;
或可能禁用它,但我寧願在初始化時執行它,而不必避免調用代碼,如果用戶點擊後退按鈕並返回到wpSelectTasks
。