It's pretty basic.. oops, I mean _simple_ :-)
IF TYPE("THIS.cntMenu") = "O"
THIS.REMOVEOBJECT('cntMenu','Container')
ENDIF
THIS.ADDOBJECT('cntMenu','Container')
THIS.cntMenu.VISIBLE = .T.
>>>>I have a container class with 2 - 20 label object in it that I can't seem to get rid of... I'd like to remove the container from the form and re-build from scratch but when I use REMOVEOBJECT() then ADDOBJECT() I get the message "An object with that name already exists"... What would prevent removeobject from working?
>>>>
>>>>TIA
>>>I replied with regard to removeobject(), addobject() but BTW do you really need to rebuild from scratch by remo.. addo.. ? I think browsing through the labels and changing properties or setall at once could be more suitable.
>>>Cetin
>>
>>Thanks, Cetin
>>
>>Actually, I'm experimenting with the 'best' method right now. I've tried the browsing approach, but the problem there is that the container could have more (or less) labels on it. So I'd need to add labels (if there were too few existing labels) or remove / hide labels (if there are too many).
>>
>>I'm thinking that I can't remove the labels because they're still visible. If that's so, would a LOCKSCREEN allow the 'image' of the labels to remain visible while the control is rebuilt in the background?
>>
>>Thanks again
>Hi Larry,
>It wouldn't matter for removeobject if the control is visible or not. You could even removeobject from a method of itself. Could you provide the code so I can see what is going on ?
>Cetin