Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parent abuse
Message
From
02/02/2000 15:43:56
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00321381
Message ID:
00326373
Views:
26
>I have created a container class that includes a "Close" command button. I want the button to remove the parent container. (It is added earler thru a NewObject().) I would like to keep it generic in the class Click() method of the button by mentioning the heirarchy instead of the instantiated name of the container. I tried this:
>
> THIS.Parent.Parent.RemoveObject(THIS.Parent)
>
>in the button's Click(), and the results are not pretty.
>
>How can I do this? CAN I do this?
>
>Thanks for help.

In the container, create a ReleaseMe() method, with the following code:
RELEASE THIS

Then, on the Commandx.Click() method, put the following code:
THIS.Parent.ReleaseMe()

This one is simple and it works. I just tested it: no GPF at least on NT :-)

Have fun!
Previous
Reply
Map
View

Click here to load this message in the networking platform