Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remove all objects from a container?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01192611
Message ID:
01193250
Views:
12
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform