Inno Setup:如何在选中的复选框上显示 (hide/unhide) 密码
Inno Setup: How to show (hide/unhide) password on checkbox checked
我正在向我的输入查询页面添加一个复选框,以便在选中时显示未发现的密码。但是我不知道该怎么做。
我已经创建了以下程序。但是这个过程并没有改变我在添加输入时的真假值。此过程为我添加了完成这项工作的新文本框。
你能帮帮我吗?
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;
使用TPasswordEdit.Password
属性:
[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;
我正在向我的输入查询页面添加一个复选框,以便在选中时显示未发现的密码。但是我不知道该怎么做。
我已经创建了以下程序。但是这个过程并没有改变我在添加输入时的真假值。此过程为我添加了完成这项工作的新文本框。
你能帮帮我吗?
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;
使用TPasswordEdit.Password
属性:
[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;