Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trying to set property on another form....
Message
 
À
28/08/1998 03:25:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00130896
Message ID:
00130920
Vues:
27
Tim,

Let's call the two forms Parent (On top but not active) and Child (Active). If the Child must manipulate the Parent there are a number of ways to do this. One way is to have Child return a value to Parent and let Parent manipulate itself based on what Child returns.

Another way is to pass a reference to Parent as a parameter to Child by doing this from a method of Parent;

DO FORM Child WITH THISFORM

In Child you would create a custom property named oParent and do this in its Init event;

LPARAMETERS poParent
THISFORM.oParent = poParent

Then in Child you can address the Parent through;

THISFORM.oParent.SomeProperty = SomeValue

In this approach you do need to add a line of code to the Child form's Destroy event;

THISFORM.oParent = .NULL.

To release the external object reference to the Parent form.

Either of these approaches removes the need for global variables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform