Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Defining Methods in Classes for Objects Added at Runtime
Message
From
16/02/2006 20:21:07
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Defining Methods in Classes for Objects Added at Runtime
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01096949
Message ID:
01096949
Views:
65
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
Next
Reply
Map
View

Click here to load this message in the networking platform