Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to access the parent form property in child form obj
Message
 
 
To
05/06/2014 13:40:58
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP3
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01601319
Message ID:
01601371
Views:
34
>Which is how I do it. In my custom form baseclass, I have a property called oCaller to hold a reference to the calling program. In the init I have this code:
>If Type([_screen.activeform.name]) = [C]
>   This.oCaller = _Screen.ActiveForm
>Endif
>
>>in the init of the childform the current active form is still in _VFP.activeform
>>so you can add formproperty to all forms and in init set it to _VFP.ActiveForm
>>
>>
I haven't re-tested this recently, but as I recall, ActiveForm can only be used in Form's Load, Init is too late.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform