Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Referencing objects from a parent form
Message
De
05/01/1998 08:14:22
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:
00069476
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!

Hi Gill,
The reverse was a challenge for me when I started VFP (that is - do form formB, click on FormA, do something in FormB ). If you need also you get the reference by "do form formB name FormBRef".
Happy new year.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform