Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to pass an object to a form
Message
De
14/11/2010 14:34:01
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
01489074
Message ID:
01489077
Vues:
78
>I have a summary form, which loads various detail forms. On the summary form, I have some objects that I would like to pass to the detail form in order to not reproduce logic. I know I can save those objects as a class and handle that way, but I'm wondering if this is possible?
>
>I know how to pass an object, but how to add that object to the detail form?


You can add custom property, pass object reference via init method and then store it to that custom property.
Then you can use/reference everything from that attached form.
*receiving form init
lparameters oSummaryForm  &&receive object reference
this.oSummaryForm=oSummaryForm  && Store it to custom property

*From here and on you can call/reference anything from that passed form anywhere in receiver form
SomeValue=thisform.oSummaryForm.SomeObject.SomeMethod()


**Before releasing form make sure you release reference of passed form as well
thisform.oSummaryForm=null
HTH
Sergio
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform