I understand HOW to destroy the elements, and WHY to do so..I don't think I was coherent when I wrote that.
let me try again:
custom control has n contained objects (all the same, contained in the control, added/manipulated at runtime). I need to force these into a logical order. using container.Controls(index) does not let me reorder the array items. What I am currently doing is when AddObject is called, it also adds a reference to the object in a custom property "Items[]". I can then re-order the elemnts of Items, so I can quickly grab Item 7, without searching potentially the entire controls array.
The problem arises when my form is closed (this control is designed to be re-used) the form.Destroy() method is called, but the control.Destroy() (which NULLs all the values) does NOT, and it hangs. I am looking for some alternative to do this.
Is that clearer? The only alternative I can think of is for me to code EVERY container object.Destroy to do
FOR EACH o IN THIS.Controls
o.RELEASE()
ENDFOR
Which is really ugly, and then I can not guarantee that my control can be used outside my own environment.
>>When my form does a destroy() - it destroy's itself but hangs there. my control's destroy() has code to NULL these references out, but it never gets called.
>Tim, do I get it right, that you want your custom control to keep the references to some objects (other than in form you are destroying) after your form is destroyed? In this case do you just NULL the array elements pointing to that particular form objects?
>
>Nick
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only