Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling an object in other form
Message
De
06/09/2005 08:27:04
Jim Winter
Jim Winter Consulting
Hinesburg, Vermont, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01046890
Message ID:
01046954
Vues:
17
>I have 2 independent forms, the form1 opens form2. From a command button in the form2, i tried to refresh the grid placed in form1, but visual foxpro can not locate the object. I used: form1.object.refresh but it didn't work. I would like to know how can i specify the complete path of an object, to be sure that vfp will find it. I know there's a _screen variable, but i don't know how to use it or if this will be the solution to my problem. Thanks for your time. God bless.
>
>Rodrigo Aguilera
>Digital Media Specialist
>www.RodrigoAguilera.com

First, add a property to your base form class called oParentForm.
Then, in the LOAD event of Form2, you can put code like the following:
IF TYPE( “_Screen.ActiveForm” ) = “O”
  This.oParentForm = _Screen.ActiveForm
ELSE
  This.oParentForm = NULL
ENDIF
This will give you an object reference to the calling form that you can use to manipulate objects on that form.

HTH,
Jim
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform