Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which object called me?
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00859119
Message ID:
00859142
Views:
16
>Hello all,
>
> How do I tell a form which commandbutton on another form called it?
>
>Thanks

Not related to MM framework in any way, but here is a little trick:

When the called form initializes, the _screen.ActiveForm still points to the calling form.

So, in the FORM2.Init()
oCallingForm =_screen.ActiveForm && gives you the reference to the calling form
oCallingControl = _screen.ActiveForm.ActiveControl  && gives you the reference to the button it was called from.
This allows to avod passing any parameters. You can save the object references to the Form2 properties if you want. And I would prefer to save the hierarchy names (SYS(1272)) instead, to avoid the dangling object references. You can always get the object reference again with EVALUATE() function when necessary.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform