Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Referencing objects from a parent form
Message
 
To
02/01/1998 08:40:21
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00068555
Message ID:
00069292
Views:
59
>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform