本文介绍如何实现“勾选式的协议页面。
界面预览:
在[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;