Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using BindEvent to close a form when parent closes
Message
From
12/07/2009 08:08:18
 
 
To
12/07/2009 03:41:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01411652
Message ID:
01411673
Views:
43
This would work using bindevent. I have not had any daggling reference problem with the method I described -- the user can close either form; the parent will always close the child if the user closes it. The child works independently. Even if you don't reset the parent form's property back to null, there is not a problem (the null is to use the ISNULL function which is a preference of mine) as VFP will still clear the object form and the property will be undefined. Instead of resetting back to NULL you could use the VARTYPE to determine if the parent property is linked to the child form (is an object).

As for BINDEVENTS -- I have found more causes of C5 occurring if the bindevent is not cleared or is stepped on by another process. In short I try to stay away although I do find uses for this functionality and do use it (just sparingly).
Previous
Reply
Map
View

Click here to load this message in the networking platform