我在输入查询页面上添加了一个复选框,以便在选中该复选框时向我显示未发现的密码。但是我不知道该怎么做。
我已经创建了以下过程。但是,此过程不会改变添加输入时的真假值。此过程为我添加了完成该工作的新文本框。
请你帮助我好吗?
procedure SPCheckBoxChecked(Sender: TObject);
begin
if Assigned(SPCheckBox) then
begin
if SPCheckBox.Checked then
CredentialsPage.Add('Password:', False)
if not SPCheckBox.Checked then
CredentialsPage.Add('Password:', True)
end;
end;
[Code]
var
InputQueryPage: TInputQueryWizardPage;
procedure ShowPasswordCheckClick(Sender: TObject);
begin
InputQueryPage.Edits[0].Password := not TNewCheckBox(Sender).Checked;
end;
procedure InitializeWizard();
var
ShowPasswordCheck: TNewCheckBox;
begin
InputQueryPage := CreateInputQueryPage(
wpWelcome, 'Password prompt', 'Please enter your password', '');
InputQueryPage.Add('Password:', True);
ShowPasswordCheck := TNewCheckBox.Create(WizardForm);
ShowPasswordCheck.Parent := InputQueryPage.Surface;
ShowPasswordCheck.Top :=
InputQueryPage.Edits[0].Top + InputQueryPage.Edits[0].Height + ScaleY(8);
ShowPasswordCheck.Height := ScaleY(ShowPasswordCheck.Height);
ShowPasswordCheck.Caption := '&Show password';
ShowPasswordCheck.OnClick := @ShowPasswordCheckClick;
end;
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句