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

Click here to load this message in the networking platform