本文介绍如何实现“勾选式的协议页面。
界面预览:
在[Code]段添加以下代码:
var
Label1: TLabel;
CheckBox1: TCheckBox;
procedure Cus_Next(Sender: TObject);
begin
if CheckBox1.Checked = True then
WizardForm.LicenseAcceptedRadio.Checked := True
else
WizardForm.LicenseNotAcceptedRadio.Checked := True
end;
procedure InitializeWizard();
begin
WizardForm.LicenseMemo.Height := 137;
WizardForm.LicenseAcceptedRadio.visible := False;
WizardForm.LicenseNotAcceptedRadio.visible := False;
Label1 := TLabel.Create(WizardForm);
Label1.Parent := WizardForm.LicensePage;
Label1.Left := WizardForm.LicenseMemo.Left;
Label1.Top := WizardForm.LicenseMemo.Top + WizardForm.LicenseMemo.Height + 7;
Label1.Width := WizardForm.LicenseMemo.Width;
Label1.Height := ScaleY(12);
Label1.Caption := '如果您接受许可协议,请点击下方的单选框。您必须接受协议才能安装 MyProg'#13'1.0,单击[下一步(N)]继续。';
CheckBox1 := TCheckBox.Create(WizardForm);
CheckBox1.Parent := WizardForm.LicensePage;
CheckBox1.Left := WizardForm.LicenseMemo.Left;
CheckBox1.Top := WizardForm.LicenseMemo.Top + WizardForm.LicenseMemo.Height + 37;
CheckBox1.Width :=WizardForm.LicenseMemo.Width;
CheckBox1.Height := ScaleY(17);
CheckBox1.Caption := '我同意“许可协议”中的条款(&A)';
CheckBox1.TabOrder := 0;
CheckBox1.OnClick := @Cus_Next;
end;
创建勾选式协议页面
本文详细介绍了一种在安装程序中实现勾选式许可协议页面的方法。通过添加自定义控件和事件处理,确保用户在继续安装前明确同意许可条款。
![Inno <wbr>Setup技巧[界面]勾选式的协议页面](https://i-blog.csdnimg.cn/blog_migrate/10f8d81ce86f9ed88d607c0537b77035.jpeg)
963

被折叠的 条评论
为什么被折叠?



