Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How Can I get Top-Level Form Name?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00817434
Message ID:
00817705
Vues:
25
>If every form has a property to hold the value of 'calledby' and the init of every form captures this value passed to it from the calling form and stores it in its 'calledby' property, checking the form's 'calledby' property will always give you the calling form. You could also create a _screen property for each form at the beginning of the app or when the form is called by the parent if the property does not already exist and before calling the childform, store the value of the calling form there and then every form (if only allowed to run once and not multiple instances) could check that value. You would have to empty that value or replace it with null when the form is closed. Otherwise an array as has been recommended would work.

BTW, sorry FJI, Tracy, but I figured you'd left for day and we had replied the same anwers, anyway. I just wanted to mention that I use the property method you describe (except not with _screen, but with app object, only difference) in my TL form-launchers, and I find it to be perfect, at least for my needs.

But if it gets much more complex situation as this case appears it might be, than the array/cursor idea might be better. But personally, I wouldn't want to get more complex that I already use, I think it may become a possible flawed-design issue at that point, and maybe time to re-assess things. (but hard to say with seeing it, of course)
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform