iup_s wrote:
> procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
> begin
>    if Self.Parent.Parent is TfrmScrollBoxTest then
>       TfrmScrollBoxTest(Self.Parent.Parent).objList.Remove(Self);
> end;

The cool thing about TComponentList is that you don't need any of that 
code. The list can be the owner of the components it holds, so when any 
of those components gets freed, the list gets notified automatically (by 
use of the TComponent.Notification method).

If you want the child form to be freed when you close it, set the Action 
parameter to caFree in the OnClose event above.

Also, when you create your child forms, I don't think CreateParented is 
really the constructor you want. That constructor is for when the 
desired parent isn't a VCL object -- when it's *just* a window handle, 
like from another application that's not written in Delphi. Since you 
have access to the full VCL, use it. You're already setting the form's 
Parent property anyway.

-- 
Rob


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income homes are not online. Make a difference this holiday season!
http://us.click.yahoo.com/5UeCyC/BWHMAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to