This actually works for me:
FOR lnCounter = ThisForm.cntDetails.ControlCount to 1 step - 1
ThisForm.cntDetails.RemoveObject(ThisForm.cntDetails.Controls[m.lnCounter].Name)
ENDFOR
....which is what she suggested - the only things that I changed were one variable name and I'm running it from a method outside the container (hence the reason I'm using something like 'thisform.mycontainer'.
>I'm affraid this code wouldn't work. It should be something like:
>
>
>do while this.ControlCount#0
> this.RemoveObject(this.Controls[this.ControlCount].name)
>enddo
>
>
>And I would use .Objects & .Objects.Count instead of .Controls & .ControlCount
>
>Regards,
>Sergey
>
>>>>Anyone got a code snippet to remove all objects from a container?
>>>>
>>>>Thanks!
>>>
>>>From the top of my head (not tested)
>>>
>>>for lnI = this.ControlCount to 1 step - 1
>>> this.RemoveObject(this.Controls[m.lnI].name)
>>>next
>>
>>Perfect! I'd forgoten about the controlcount propery....
ICQ 10556 (ya), 254117