Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Defining Methods in Classes for Objects Added at Runtime
Message
 
 
À
16/02/2006 20:21:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01096949
Message ID:
01096950
Vues:
13
You should define MouseEnter method for my_label class and put code in the my_label class.

>Forum,
>
>If I add an objects at runtime from within a class method, how do I define methods for those objects? Example:
>
>
>define class MY_CLASS as CUSTOM
>
>   my_container = .null.
>
>   procedure Init
>      my_container = CreateObject('CONTAINER')
>      my_container.AddObject('my_label', 'LABEL')
>   endproc
>
>EndDefine
>
>
>Now, let's say I want to define a procedure for handling the MouseEnter() event for my_label. How would I do that? I envisioned something like this within the class:
>
>
>Proocedure This.my_container.my_label.MouseEnter
>   ...
>EndProc
>
>
>I tried this, but VFP complained, saying that This was an unknown member.
>
>Thank you.
>
>Eric
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