Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reference to parent form
Message
De
09/03/2009 17:09:00
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01386778
Message ID:
01386785
Vues:
53
>>Dear All
>>
>>If I have an object reference to an object contained in another object
>>
>>
>>
>>function SomeFunction
>>lparameters oControl
>>
>>*oForm=??
>>
>>
>>
>>How do I grab object reference of a form that contains that object. I remember seeing posts in the past with some looping
>>up to the form level. Is that only way, or am I overlooking some foxpro function that can get to it straight.
>>
>>What I need is oControl.parent.parent.parent->> until parent is actually Form itself.
>>
>>TIA
>>Sergio
>
>I don't see a way to do it except for looping until oControl.Parent.BaseClass = 'Form'

Okay :)
 Function GetParentForm
        lparameters oControl
        local oParent
        oParent  = oControl.parent  
        do while oParent.baseclass<>'Form'
           oParent  = oControl.parent  
           oControl = oParent         
        enddo 
        return  oParent
*****************
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