Autor Beitrag
Grafix
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

Windows 7 Professional
Delphi 2009, PHP, Prolog, Python, Java
BeitragVerfasst: Sa 24.04.10 12:58 
Moin,

wenn ich in Form2 den befehl Form1.Close; ausführe, schließen sich dummerweise beide... Ich habs versucht mit Form1.Visible := False;, aber das ist auch nichts gescheites, erstens des Programmierstils wegen und außerdem kann ich das Programm dann nicht mehr über den X Button oben in der Leiste schließen - da Form1 ja immernoch ausgeführt wird :shock:
Wo liegt der Fehler?
Thx
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Sa 24.04.10 13:16 
Weil dein Programm ein Hauptfenster braucht. Wenn du das Hauptfenster schließt, dann schließt sich das ganze Programm. Lösung des Problems wäre das du ein anderes Fenster zum Hauptfenster machst, oder dein Hauptfenster mit Form1.Hide; nur versteckst und sobald du es wieder brauchst mit Form1.Show; wieder herholst.

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Grafix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

Windows 7 Professional
Delphi 2009, PHP, Prolog, Python, Java
BeitragVerfasst: Sa 24.04.10 13:22 
Hm, das Problem bei Form1.Hide; ist anscheinend das selbe wie bei Visible... wenn Form2 geschlossen wird, bleibt Form1 im Hintergrund aktiv...
Wie kann ich ein anderes Form zur Hauptform machen??
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 480

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Sa 24.04.10 13:47 
user profile iconGrafix hat folgendes geschrieben Zum zitierten Posting springen:
außerdem kann ich das Programm dann nicht mehr über den X Button oben in der Leiste schließen - da Form1 ja immernoch ausgeführt wird :shock:

Schreib doch einfach ins OnClose-Event der zweiten Form ein Form1.Close; rein, dann sollte sich das Programm beenden. :)

_________________
We are, we were and will not be.
Grafix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

Windows 7 Professional
Delphi 2009, PHP, Prolog, Python, Java
BeitragVerfasst: Sa 24.04.10 13:54 
So einfach wie genial - und es funktioniert =) Danke!