Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Referencing objects from a parent form
Message
 
À
02/01/1998 08:40:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00068555
Message ID:
00069292
Vues:
48
>>Basically what I'm trying to do is operate controls in one form from another form. In form A I have a grid and in form B I'd like to issue commands that will control the grid that I have in form A.
>>Sounds simple but I haven't been lucky to get the right command.
>>They are separate forms, not components of a formset.
>>Thanks,
>>
>>Gil
>>
>Hi Gil,
>Forms need not be in a formset. They are objects too so you could reference one from other. When calling Form B also pass form A as an object reference.

>In formA : Do form FormB with thisform
>In formB init store formA's reference to a property:
>
>lparameters oFormRef
>thisform.oCaller=oFormRef
>
>And anywhere in FormB issue commands that will act on FormA.grid :
>
>thisform.oCaller.grid1.column1.text1.value = "NewValue"
>thisform.oCaller.grid1.refresh
>wait window "Any key to setfocus to grid in FormA"
>thisform.oCaller.grid1.setfocus()
>
Cetin, thanks a lot! That was exactly what I needed. I created the property, called the form, assigned the value to the property, issued my command and presto! smooth operation. Thanks a lot, I really appreciate the help and have a great happy new year!

Gil

I love this thread!
For every bug fixed, there is a bigger bug not yet discovered.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform