Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RemoveObject... doesn't !!!
Message
From
17/04/1998 18:25:52
 
 
To
17/04/1998 11:04:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00092409
Message ID:
00093076
Views:
31
>>It's pretty basic.. oops, I mean _simple_ :-)
>>
>>
>>* add / update menu option containers and scrollbar
>>IF TYPE("THIS.cntMenu") = "O"
>>  THIS.REMOVEOBJECT('cntMenu','Container')
>>ENDIF
>>THIS.ADDOBJECT('cntMenu','Container')   &&<<<<<<< object with that name already exist
>>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
>Hi Larry,
>How is it going. With the code on hand I would add something to what Barbara has said. Also there is another scenario that removeobject might never get executed :
>
>* Form has custom property cntMenu
>this.cntMenu = "cntMenu"                && Holds the name of an object - type() = "C"
>THIS.ADDOBJECT('cntMenu','Container')   && Object is added somewhere in code
>IF TYPE("THIS.cntMenu") = "O"           && Fails
>  THIS.REMOVEOBJECT('cntMenu')
>ENDIF
>THIS.ADDOBJECT('cntMenu','Container')   &&<<<<<<< object with that name already exist
>THIS.cntMenu.VISIBLE     = .T.
>
>Cetin

There was a variable reference to the object... thanks for your help
Previous
Reply
Map
View

Click here to load this message in the networking platform