Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to access a top level form from another ?
Message
De
17/04/2012 12:09:50
 
 
À
17/04/2012 09:26:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01541821
Message ID:
01541850
Vues:
36
You need to have a form manager. But in absence of a full manager you can use simple properties:
ADDPROPERTY(_VFP,"FormOne",.NULL.)
ADDPROPERTY(_VFP,"FormTwo",.NULL.)
...

DO FORM TopLevelOne TO loForm
IF VARTYPE(loForm) = "O"
   _VFP.FormOne = loForm
ENDIF
...

DO FORM TopLevelTwo TO loForm
IF VARTYPE(loForm) = "O"
   _VFP.FormTwo = loForm
ENDIF
In the destroy event of the respective form set the reference property to null; i.e. for TopLevelTwo form add the following:
_VFP.FormTwo = .NULL.
Now you can reference either form via the appropriate _VFP variable. First always test for form instance:
IF !ISNULL(_VFP.FormOne) .AND. VARTYPE(_VFP.FormOne) = "O"
  *-*  Do something with the form
ENDIF
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform