Autor Beitrag
VD
Hält's aus hier
Beiträge: 8



BeitragVerfasst: Mi 09.06.04 19:24 
folgendes:

ich erstell dynamisch neue Forms

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
new( Form );
Application.CreateForm( TBildchenForm, Form^ );
Form.ClientHeight := 70;
Form.ClientWidth := 70;
FormListe.Add( Form );


wenn ich jetzt versuch mit
ausblenden Delphi-Quelltext
1:
PBildchenForm( FormListe.Items[ I ] ).Close;					


das ding wieder zu schliessen, dann schliesst er die form, aber leider mein hauptprogramm gleich mit.
wie kann ich letzteres verhindern?

danke schonmal :)

VD
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Mi 09.06.04 20:48 
Startest du deine Anwendung mit Application.Run; so wird sie automatisch mit dem MainForm geschlossen. Versuche statt Application.Run dochmal Application.MainForm.ShowModal; - ist nur so ne Idee.

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
ErnestoChe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 528

Win 2000 pro, CRUX 2.0
Delphi 6 Pers, Open K3
BeitragVerfasst: Do 10.06.04 20:52 
Hallo,

VD hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
new( Form );
Application.CreateForm( TBildchenForm, Form^ );


Objekte sind schon Zeiger. Damit machst du einen Zeiger auf einen Zeiger. Und New brauchst du auch nicht. Einem Objekt weisst man Speicher auf dem Heap zu, indem man den Konstruktor der entsprechenden Klasse aufruft. Ich würde eine Form dynamisch folgendermaßen erstellen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var
  Form: TBildchenForm;

//......................

Form := TBildchenForm.Create(nil);
Form.ClientHeight := 70;
Form.ClientWidth := 70;
FormListe.Add( Form );


Das muss aber nichts mit deinem Problem zu tun haben.

MFG

- Ernesto -