Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Putting code into method at runtime
Message
 
 
À
09/12/2008 12:06:11
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01366206
Message ID:
01366230
Vues:
12
>>>I'm creating a Custom class to work with a grid at the same level. How can I get code into the MouseEnter and MouseLeave events of the grid at runtime? This class is meant to reside at the same level as the grid and the only known relationship between them at design time is that name of the grid is a property of the Custom class. I want all the rest of the stuff to happen at runtime.
>>
>>You can try BindEvent()
>
>I'm trying to get the code I will have in my custom class to be in the grid at runtime. Is this the right way to do it?
>
>BINDEVENT(THIS.PARENT.&lcGridName,"MouseEnter",THIS,"MouseEnter")
>
Yes, except I would better create a reference to the object without macro, e.g.
try
    loGrid = evaluate('THIS.PARENT.' + lcGridName)
    BINDEVENT(loGrid,"MouseEnter",THIS,"MouseEnter")
catch to loEx
endtry
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform