Einzelnen Beitrag anzeigen

axelf98

Registriert seit: 27. Aug 2003
Ort: Ennepetal
440 Beiträge
 
Delphi 2005 Personal
 
#5

Re: Hauptform unsichtbar solange Form2 vorhanden

  Alt 28. Aug 2003, 15:04
Das Problem könnte man vielleicht so lösen:

In der "Unit" Projekt1 (unter alle Units anzeigen) siehts ungefähr so aus (Project1 ist der Name des Projekts):

Delphi-Quellcode:
program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas{Form1};
  Unit2 in 'Unit2.pas{Form2};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Application.Run;
end.
Wenn jetzt Form2 zuerst kommen soll, vertauscht man einfach die Einträge:

Delphi-Quellcode:
  Application.Initialize;
  Application.CreateForm(TForm2, Form2);
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

Wenn jetzt Die Passwortangabe richtig war:
Delphi-Quellcode:
 form2.visible := false //Passwortfenster wech
 form1.visible := true //Anwendung sichtbar

HINWEIS: Da jetzt Form2 das Hauptform ist, muss das auch beim Beenden des Programms geschlossen werden: Einfach unter formX.close "form2.close" schreiben!
  Mit Zitat antworten Zitat