Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to change properties on a form from another?
Message
 
À
03/09/1999 18:19:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00261429
Message ID:
00261436
Vues:
18
Hi Doug,

Directly changing 1 objects properties from another is not considered good OOP. You should provide methods in the recieving object that you can call and let the receiving object make the changes itself.

It's kinda of like asking someone else changing your socks as opposed to someone asking you to change your socks (your probably better at it than they are. < s >

IAC- The 2nd form will need to have a refrence to the first form (you know that already didn't you :). The easiest way is to simply pass a parameter to the 2nd form.

In the 2nd form create a property called oForm1. Now from MyForm1 call MyForm2 like this:
do MyForm2 with this
In the second forms init catch the parameter and put it in the property.
lparameters oForm
thisform.oForm1 = oForm
Now from anywhere on the form you can access any PEMs of Form1 like this:
thisform.oForm1.Top = 5
thisform.oForm1.Refresh()
>Hi,
>
>I have one form with private datasession which calls another with DO FORM. These forms are not part of a form set, so how can I change properties in the calling form (if at all).
>
>Regards
>Doug Johnston
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform