Hallo,
ich hänge an folgendem Problem:
Meine Projekt-Datei sieht folgendermaßen aus:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21:
| program Programm;
uses Forms, map in 'units\map.pas' , hauptform in 'units\hauptform.pas' , ueber in 'units\ueber.pas' , ergebnis in 'units\ergebnis.pas' , protokoll in 'units\protokoll.pas' , bestenliste in 'units\bestenliste.pas' , bestenliste_name in 'units\bestenliste_name.pas' , first_screen in 'units\first_screen.pas' , modules in 'units\modules.pas' ;
{$R *.res}
begin Application.CreateForm(Tmodul, modul); Application.Initialize; Application.Run; end. |
Wie man sieht, wird nur das Form Modul erzeugt und angezeigt!
Nun wähle ich in diesem Form aus einer Listbox einen Wert aus und führe dann die Procedure load_modul(string); aus:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24:
| procedure Tmodul.load_modul(name: string); begin modul.Hide; modul_add := name + '_'; Application.CreateForm(TSplashScreen, SplashScreen); try SplashScreen.Show; SplashScreen.Update; Application.Title := 'GlobeMem - Vereinigte Staaten von Amerika'; Application.HelpFile := ''; Application.CreateForm(Tmain, main); main.bild.Picture := SplashScreen.bild.Picture; Application.CreateForm(Tabout, about); Application.CreateForm(Tkarte, karte); Application.CreateForm(Tresult, result); Application.CreateForm(Tproto, proto); Application.CreateForm(Tscore, score); Application.CreateForm(Tscore_name, score_name); SplashScreen.Hide; finally SplashScreen.Free; main.ShowModal; end; end; |
Und hier ist mein Problem!
Ich muss das Formular Modul immer selbstständig schließen!
Füge ich nach dem main.Show oder main.ShowModal ein modul.close; ein, wird das nicht ausgeführt!
Auch wird durch modul.Hide das Formular nicht versteckt und durch modul.Visible = false erst recht nicht!
wenn ich ein modul.Free einbaue, gibts nen Access-Error und wenn ich das modul.Close in die OnClose der Hauptform einbau, wird das auch nicht ausgeführt!
Bin ich gerade stockblind oder wo ist das Problem?
Würde mich freuen, wenn mir jemand auf die Sprünge helfen könnte...
gruß
Timelesk