>I developed an application with a screen designer where the user can create, destroy, drag and drop objects at Run-Time etc. For this purpose I created an object repository to do all my housekeeping etc.
>
>When I destroy all the objects on a form from the repository before starting to create new ones, I ran into a timing problem. Although the nessecary method to remove all the objects from the form was executed, and the Forms ControlCount property indicated that all objects were destroyed, they were not. We started to create new controls causing a bug due to clashes on control names.
>
>Does anyone know how to wait and check if all controls have actually been destroyed before resuming execution, without using a loop as this will stop the objects from being destroyed until you exit the loop which puts you back at square one. (This also goes for Inkey() and WAIT).
>
>We bypassed the problem by alternating between 2 forms. While the one form is getting destroyed we start populating the next on, but I would love to know how to do this by only using one form.
>
>PS. The problem only occur when we remove a large amount of different objects at once.
Otto
Try releasing the memory variable they are tied to.
HTH,
Tom