问题描述
如何在 Inno Setup 创建的文件夹选择对话框中添加复选框,如下图所示?
解决方法
将复选框的 Parent
属性设置为 WizardForm.SelectDirPage
:
var
Checkbox: TNewCheckBox;
procedure InitializeWizard();
begin
Checkbox := TNewCheckBox.Create(WizardForm.SelectDirPage);
Checkbox.Parent := WizardForm.SelectDirPage;
Checkbox.Top := WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + ScaleY(8);
Checkbox.Left := WizardForm.DirEdit.Left;
Checkbox.Caption := 'My checkbox';
// See https://stackoverflow.com/q/30469660/850848
Checkbox.Height := ScaleY(Checkbox.Height);
end;