Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatically creating method or event procedure
Message
From
23/02/1999 02:12:57
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00189903
Message ID:
00190336
Views:
14
I know how to create my own subclass of base class, I want only change metods and events of object created from base class. But if it is not posssible, I must use subclassing.

Thanks for advice.

Maros Klempa


>You really don't want to be doing it that way at runtime. You are better off in the long run creating a class with the needed method code.

>create class cCommandButton of maroslib as CommandButton && you want a common >class that all CommandButton subclasses will inherit from
>create class cmdCancelBtn of maroslib as cCommandButton from maroslib

>Then to runtime use it:

>set classlib to maroslib additive
>thisform.AddObject( "cmdCancelBtn", "cmdCancelBtn" )

>>How to programmatically create method or event procedure of added object?
>>I have form. In init event of this form I want add object and set up properties ,metods and events of this object.
>>For example, next few lines create command button and set up caption and cancel properties.
>>
>>THISFORM.ADDOBJECT("cmdCancelBtn",'commandbutton")
>>WITH THISFORM.cmdCancelBtn
>> .CAPTION="quit"
>> .CANCEL=.T.
>>ENDWITH
>>
>>But how can I write, for example, procedure for CLICK event?
>>
>>Thanks
>>
>>Maros Klempa
Previous
Reply
Map
View

Click here to load this message in the networking platform