Thema: Delphi Login auf form2

Einzelnen Beitrag anzeigen

Benutzerbild von SirThornberry
SirThornberry
(Moderator)

Registriert seit: 23. Sep 2003
Ort: Bockwen
12.235 Beiträge
 
Delphi 2006 Professional
 
#7

Re: Login auf form2

  Alt 11. Sep 2007, 15:58
bei mir sieht es so aus:

unit2 (benennung sieht bei mir natürlich besser aus)
Delphi-Quellcode:
TForm2 = class(TForm)
[...]
public
  class function Execute(): Boolean;
end;
[...]
class function TForm2.Execute(): Boolean;
var
  lForm: TForm2;
begin
  lForm := TForm2.Create(nil);
  try
    result := lForm.ShowModal = mrOK;
  finally
    lForm.Free;
  end;
end;
[...]
procedure TForm2.ButtonOKClick(Sender: TObject);
begin
  if PasswortRichtig() then
    ModalResult := mrOK;
end;

Projektdatei
Delphi-Quellcode:
[...]
Application.Initialize;
if TForm2.Execute() then
begin
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end;
[...]
Jens
Mit Source ist es wie mit Kunst - Hauptsache der Künstler versteht's
  Mit Zitat antworten Zitat