Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Defining Methods in Classes for Objects Added at Runtime
Message
De
16/02/2006 20:21:07
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Defining Methods in Classes for Objects Added at Runtime
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01096949
Message ID:
01096949
Vues:
63
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform