Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which object called me?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00859119
Message ID:
00859142
Vues:
15
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform