Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to reference an other form than the mainform ?
Message
De
30/04/2001 14:18:28
 
 
À
30/04/2001 14:01:12
Ing. T.R.M. Pluym
Pluym Elektronics Bv
Hulst, Pays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00499895
Message ID:
00501686
Vues:
40
That can be handled in a variety of ways.

Some update the related from only when the related form is activated. But, in this scenario, the data available to the user isn't all in sync.

For that, the main form must have access to an object reference for the related form. If it's a parent/child situation -- the main form is called from the related form -- you can do the following:

Pass an object reference as a parameter to the main form.
DO MainForm WITH THISFORM
In the INIT of the main form, store the object reference to a property of the form.
PARAMETERS    toCallingForm
THIS.oCallingForm = toCallingForm
Then, in whatever method/event you want:
THIS.oCallingForm.Refresh()
If you want to update another form that hasn't been called in that nested fashion, you'll need to log that form in property of your application object, or a global variable.

In your main program:
PUBLIC   oUpdateMe
oUpdateMe = .NULL.
In the INIT of the related form:
oUpdateMe = THISFORM
In the desired method of the main form:

IF NOT ISNULL (oUpdateMe)
oUpdateMe.Refresh()
ENDIF

HTH,

Jay
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform