Autor Beitrag
Bulvaye
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37

Windows Xp
Delphi 7 Enterprise
BeitragVerfasst: Mo 27.11.06 11:45 
Wie kann ich zur Laufzeit das MainForm wechseln?

Problemfall:
Die Anwendung startet mit einem Form1 als Hauptformular. Aus diesem Formular heraus kann der Benutzer das Fenster zerstören, ein Form2 erzeugen und dieses ab sofort als MainForm nutzen (und umgekehrt - eine Art "Moduswechsel").


Wie kann ich dies bewerkstelligen? Wie kann ich zur Laufzeit das aktuelle Mainform zerstören, ohne dass sich die Anwendung beendet und ein neu erzeugtes Form zum MainForm machen?

Vielen Dank für ein paar Tipps. :)

_________________
Gesegnet ist, dessen Geist zu klein für jedweden Zweifel ist.
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Mo 27.11.06 13:30 
Einfach die MainForm nur verstecken. In OnClose der MainForm schreibst du dann
ausblenden Delphi-Quelltext
1:
Action := caHide					

Aber nicht vergessen, ACtion auf "caFree" zu setzen, wenn du die Anwendung beenden willst (außer du benutzt application.terminate)!

Gruß alias5000

_________________
Programmers never die, they just GOSUB without RETURN