Where is this code that you want to add at runtime located? Use BINDEVENT() to delegate the When (or any) event to the object method where this code is located. If the code is in a memo field, for example, you will need to compile this code into a class at runtime then create an instance of that class so you can use the BINDEVENT to delegate your events.
>I have a form that has an area on it that one of several container class objects can be programatically added to it at runtime depending on a condition. Adding the container object from a class lib to the form at runtime works. But now I've had to extend things a bit and add a new textbox to the new container object that I just added to the form. And I've got that to work. But now I need to add some code to the When event of this new textbox at runtime. I know this sounds kind of convoluted but that's my task. Is there a way to do this? I can't find anything when I search VFP80 help or the UT.
>
>Any help would be greatly appreciated.
>
>Jim White
Mark McCasland
Midlothian, TX USA