inno-setup - 返回时正在创建重复页面
问题描述
我创建了单击下一步时创建的自定义页面。但是单击下一步后,我要返回,再次单击下一步,会创建重复页面。
function NextButtonClick(CurPageID: Integer): Boolean;
begin
if CurPageID = wpSelectTasks then
begin
myPage := CreateCustomPage(wpSelectTasks, 'ABC', '');
CustomPageID := myPage.ID;
StaticText5 := TNewStaticText.Create(myPage);
StaticText5.Caption := 'BCD ';
StaticText5.AutoSize := True;
StaticText5.Parent := myPage.Surface;
StaticText5.height:=14;
StaticText5.Font.size := 8;
end
else
begin
Result := True;
end;
解决方案
您应该在名为"InitializeWizard"的特殊预定义事件过程中创建所有附加页面。确保全局声明此处使用的所有(对象)变量(例如 myPage、CustomPageID、StaticText5 等)
procedure InitializeWizard;
begin
// Create custom pages here...
myPage := CreateCustomPage(wpSelectTasks, 'ABC', '');
CustomPageID := myPage.ID;
// ... followed by the page design specific creates and assignments:
StaticText5 := TNewStaticText.Create(myPage);
// ...
// ...
end;
推荐阅读
- c# - 检测一个点是否没有被其他点包围
- typescript - Typescript inlines .d.ts 编译后导入
- typescript - TypeScript 联合类型成为交集类型混淆
- mongodb - 如何在 MongoDB 中获得百分比
- cassandra - 你如何在 Cassandra 中代表金钱?
- wpf - WPF 绑定数据网格复选框
- java - 如何向包含arraylist的主要方法抛出异常?
- r - 如何将历史档案始终保存在家里?
- python - InvalidArgumentError:不兼容的形状:[3] 与 [4]
- ios - NSPathStore2 的 UIImageView 实例泄露