J, no problem with subform, its really about the assignment of edit1
on the mainform. 

edit1 on the mainform is just a declaration of a Tedit, its not
actually on the form.

My concern is what happens to it when the subform closes.

Ed..

--- In [email protected], "Jangita" <[EMAIL PROTECTED]> wrote:
>
> Ed,
> 
>  
> 
> Are these declarations created by Delphi or are you the one who has
put them
> into the code manually?
> 
> From what I have read; if you close the sub form its tedit (the one
on the
> sub form) is deallocated automatic because when you drop a control
onto a
> form its owner property is the parent control (be it a form or a
panel) so
> when the form is freed or destroyed it automatically frees all the
> components and their "dependants" with it. This is true weather you have
> assigned its variable (in code) to another control or not.
> 
>  
> 
> Maybe if you explain what you want to achieve with this?
> 
>  
> 
> J
> 
>  
> 
> PO Box 627 00502 Karen, 
> 
> Nairobi, Kenya.
> 
> Mobile: +254 722 996532
> 
> Fixed: +254 20 2050859
> 
> [EMAIL PROTECTED]
> 
>  
> 
>   _____  
> 
> From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf
> Of edsynergy
> Sent: 23 January 2008 1:14 p
> To: [email protected]
> Subject: [delphi-en] Assigning object
> 
>  
> 
> Ok ,
> I have a main form and several sub forms that get called from the main
> form
> 
> In the public of the main form I could have something like this
> edit1:Tedit;
> 
> In my subform I have a Tedit on the form
> 
> In my subform I do this mainform.edit1 := subform Tedit; 
> 
> When I close the subform what happens to edit1 on the mainform ?
> Is it automatically unassigned, if not does it get cleaned up when the
> main form closes.
> 
> Should I in the onclose event of the subform do mainform.edit1 := nil;
> 
> All advice welcome
> 
> Best wishes Ed.
> 
>  
> 
> 
> 
> [Non-text portions of this message have been removed]
>


Reply via email to