Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to refresh one form from another
Message
 
 
À
11/10/2005 17:38:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Database:
Visual FoxPro
Divers
Thread ID:
01058106
Message ID:
01058190
Vues:
15
Antonio,

>Is it possible to execute refresh method of one form from another form?

If these two forms are regularly going to communicate with each other you should exchange an object reference because you can't be guaranteed that the memvar you and Victor were tossing around will always exist.

If you are spawning FormB from FormA and FormB needs to tell FormA to refresh:
* method that launches FormB
do form FormB with thisform
* FormB.Init()
lparameter loParentForm
this.oParentForm = loParentForm

* FormB.Destroy()
this.oParentForm = .null && clear the reference

* method where FormA needs refreshing
thisform.oParentForm.Refresh()
You can also use something like a Forms Manager object and let FormB request the manager to refresh the other form. You can use sys(2015) to create unique names for each form as they instantiate and use this name instead of holding hard object references.

You can use the _screen.Forms[] collection as another alternative to a full blown FormsManager object.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform