Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Form erzeugen, ohne Parent = Hauptform (https://www.delphipraxis.net/61359-form-erzeugen-ohne-parent-%3D-hauptform.html)

Helmi 20. Jan 2006 13:36


Form erzeugen, ohne Parent = Hauptform
 
Hallo,

ich habe eine Frage:

Geht es, und falls ja, wie, eine Form aus einer Application zu erzeugen, die die Application nicht als Parent hat? - z. B. der Desktop oder so?

Der Hintergrund ist, dass ich eine form habe, aus der eine 2. Form erzeugt wird (mom. mit Parent = nil). Wenn nun die eigentliche Form minimiert wird, wird die 2. Form auch minimiert. Diese soll aber noch sichtbar sein.

Kann man den Parent ändern oder gibt es eine ganz andere Möglichkeit mein Problem zu lösen?

ichbins 20. Jan 2006 14:07

Re: Form erzeugen, ohne Parent = Hauptform
 
ich denke du rufst die Form bisher immer so auf:
Delphi-Quellcode:
application.formcreaate(form1,tform1);
mach es doch so:
Delphi-Quellcode:
form1:=tform1.create(getdesktopwindow);

Helmi 20. Jan 2006 14:14

Re: Form erzeugen, ohne Parent = Hauptform
 
Zitat:

Zitat von ichbins
mach es doch so:
Delphi-Quellcode:
form1:=tform1.create(getdesktopwindow);

das Functioniert nicht. Denn das "Create" fordert eine TComponent und "getdesktopwindow" ist ein Handle.

Ich habe es aber jetzt mit:
Delphi-Quellcode:
TForm.CreateParented(getdesktopwindow);
getestet und das hat funktioniert!!

Vielen Dank für die Hilfe!

[offtopic]
Ich hätte trotzdem noch eine kleine Frage, die fast auch hier her passt:

Was sollte man eher verwenden um eine Form zu erzeugen:
Delphi-Quellcode:
application.formcreate(form1,tform1);
oder
Delphi-Quellcode:
Form2 := TForm.Create(self);


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:48 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz