Autor Beitrag
Stefan S.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 184


D5
BeitragVerfasst: So 12.02.06 12:05 
Kann sein, dass ich zu dem selben Thema vor Jahren schon mal einen Thread aufgemacht habe, auf jeden Fall hab ich immer noch keine Lösung dafür und es geht nun um ein anderes Projekt:

Wenn ich mit
ausblenden Quelltext
1:
2:
Form1.Hide;
Form2.Show;

ein anderes Formular aufrufe und dieses Fenster dann minimiere, dann wird am linken unteren Bildschirmrand ein extra Ding für Formular 2 angezeigt, anstatt dass Form 2 in den Task des Projektes unten "hineinminimiert" wird. Gut, das hat jetzt vermutlich keiner verstanden, deshalb hier zwei Screenshots:

So ist es normal, wenn ich Form 1 minimiere.

[url=imageshack.us]user defined image[/URL]

Dagegen wenn ich Form 2 minimiere:

[url=imageshack.us]user defined image[/URL]

Das Problem liegt vermutlich daran, dass ich Form 1 nur "verstecke" und nicht schließe und Form2 somit quasi als untergeordnetes Fenster angezeigt wird. Aber wenn ich statt "Form1.Hide;" "Form1.Close;" eingebe, wird das ganze Projekt geschlossen, auch wenn ich davor noch Formular 2 anzeigen lasse. Wie kann ich also ein anderes Fenster so anzeigen lassen, dass Form 1 nicht mehr versteckt geöffnet ist? Dann müsste es vermutlich stimmen, denn es geht wohl darum, dass Form2 fälschlicherweise Form1 untergeordnet wird.


Zuletzt bearbeitet von Stefan S. am So 12.02.06 12:16, insgesamt 2-mal bearbeitet
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: So 12.02.06 12:14 
Hilft es da evtl. die Application.MainForm auf das andere Formular umzuhängen?
Stefan S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 184


D5
BeitragVerfasst: So 12.02.06 12:20 
Kenn ich gar nicht, wie müsste da der Code aussehen? In der Hilfe Datei war leider kein Beispiel.
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: So 12.02.06 12:22 
ausblenden Delphi-Quelltext
1:
Application.MainForm:=Form2;					
Stefan S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 184


D5
BeitragVerfasst: So 12.02.06 12:30 
Hab ich schon ausprobiert.

Zitat:
[Fehler] Unit1.pas(32): Einer Nur-Lesen Eigenschaft kann kein Wert zugewiesen werden
[Fataler Fehler] Project1.dpr(6): Verwendete Unit 'Unit1.pas' kann nicht compiliert werden
MrFox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 208

WIN 2000 Professional, Ubuntu 5.10
D3 Prof, D7 Pers, D2005 Pers, Java (Eclipse)
BeitragVerfasst: So 12.02.06 12:44 
Dieses "Problem" ist mir auch schon aufgefallen.

Eine Lösung wäre vielleicht, beim Minimieren des Form2 Application.Minimize aufzurufen.
Bloß leider gibts kein Form.OnMinimize.

_________________
Das Leben auf der Erde mag zwar teuer sein, aber eine jährliche Rundreise um die Sonne ist gratis mit dabei.
Stefan S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 184


D5
BeitragVerfasst: So 12.02.06 13:07 
Ja, mit Application.Minimize geht es korrekt, aber das hilft ja auch nicht weiter.
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: So 12.02.06 13:25 
Stefan S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 184


D5
BeitragVerfasst: So 12.02.06 14:24 
Hm, das ist wieder was anderes, dann ist unten in der Taskleiste neben dem Eintrag "Project 1" ein extra Eintrag für Form 2. Ich hätte es eben gerne so, dass das so gehandelt wird, als gäbe es nur Form 2 und somit auch nur einen Eintrag. Und wenn dann meinetwegen Form 3 geöffnet wird und Form 2 geschlossen, soll das wiederum das übergeordnete Formular sein.

Wenn man das Application.MainForm abfrägt ist das auch Form1, nur kann man das wie es scheint nicht ändern. Wenn man das irgendwie machen könnte, dass immer das aufgerufene Formular MainForm ist...
MrFox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 208

WIN 2000 Professional, Ubuntu 5.10
D3 Prof, D7 Pers, D2005 Pers, Java (Eclipse)
BeitragVerfasst: So 12.02.06 16:01 
user profile iconDaSteve hat folgendes geschrieben:
Wenn man das irgendwie machen könnte, dass immer das aufgerufene Formular MainForm ist...


Dann bräuchte mann kein MainForm mehr. :wink:

_________________
Das Leben auf der Erde mag zwar teuer sein, aber eine jährliche Rundreise um die Sonne ist gratis mit dabei.
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: So 12.02.06 16:06 
Vieleicht wären Frames was für dich? :gruebel:
Stefan S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 184


D5
BeitragVerfasst: Mo 13.02.06 18:45 
Ich frag mich... Ihr habt doch sicher schon auch Programme programmiert, in denen man zwischen mehreren Forms hin- und herspringt. Habt ihr das da mit dem Minimieren einfach immer so gelassen?
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mo 13.02.06 19:14 
Wann immer ich ein so ein Programm gemacht habe habe ich die logische erste Seite als Hauptfenster genommen(z.B. Login Dialog) das richtige Fenster aufgerufen und diesen per Close versteckt.

Das war aber nicht so oft wie man meinen könnte i.d.R. geht es ja meist nur um Optionsdialoge und die werden Modal angezeigt und geschlossen.
Stefan S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 184


D5
BeitragVerfasst: Mo 13.02.06 20:49 
user profile icondigi_c hat folgendes geschrieben:
Wann immer ich ein so ein Programm gemacht habe habe ich die logische erste Seite als Hauptfenster genommen(z.B. Login Dialog) das richtige Fenster aufgerufen und diesen per Close versteckt.


Was, du hast das Hauptfenster per Close versteckt?
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Di 14.02.06 09:13 
Ich meinte Hide, sry
Stefan S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 184


D5
BeitragVerfasst: Sa 18.02.06 14:26 
Hm, dann gibt es wohl keine einfach Lösung für mein Problem. Ist es allgemein unnormal, dass in einem Porgramm von Formular zu Formular gewechselt wird und dabei jedes Formular gleich wichtig ist und nicht von einem Hauptformular abhängig?