Paer Toernell
asked on
Delphi Form ownership
I want to create multiple instances of a (sub)Tform that all are owned by another (main)Tform from where they where created. If the user closes a (sub)form, it should be destroyed and not be owned by the mainform. If the Mainform is closed, all subforms should all be destroyed. I guess i can do this with a new TComonentlist, but is there any functionality in the form that i can use? (probably also a TComonentlist) ?
ASKER
Can I use a TobjectList instead of the Tform as owner and still get an automatic delete in the TobjectList when i free the form?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanx
So... create forms under Main Form ownership .... and on sub form destroy - Main form will be notified... and sub form will be excluded from component list...
Open in new window
Child form's OnClose event:
Open in new window