Ich würde gar nix davon machen!
Hauptformular:
Delphi-Quellcode:
procedure TMainFrm.FormShow(Sender: TObject);
begin
PasswordFrm.ShowModal;
end;
Passwortformular:
Delphi-Quellcode:
var
AllowClose: Boolean;
procedure TPasswordFrm.AcceptBtnClick(Sender: TObject);
begin
if PasswordEdit.Text = 'Passwort' then
begin
Accepted := True;
Close;
end
else
begin
ShowMessage('Das Passwort ist ungültig!');
PasswordEdit.Clear;
end;
end;
procedure TPasswordFrm.ExitBtnClick(Sender: TObject);
begin
Application.Terminate;
end;
procedure TPasswordFrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if AllowClose = True then
CanClose := True
else
CanClose := False;
end;