Re: Events at Run time by Christian
Christian
Sat May 07 07:17:48 CDT 2005
Hello,
the standard way to do this is making a subclass of the standard
Commandbutton that comes with VFP, and writing the code that should run in
the different events directly into this subclass, you'll also have to save
the subclass into a classlibrary
then at the initialization phase of your program you issue a
SET CLASSLIB TO yourClasslib && to make the classes contained in the
classlibrary visible to VFP
then AddObject() the subclass instead of the standard button.
if you have VFP8 or beyond you can also bind to Events at runtime ..
e.g.
add a HandleClicks Method to your form
AddObject() the button's ..
then use BINDEVENTS function to bind the click events of the buttons to the
HandleClicks method of the form ..
Regards
Christian
"Mohammed Abdel-Razzak" <MohammedAbdelRazzak@discussions.microsoft.com>
schrieb im Newsbeitrag
news:58B8F32B-EC60-4F84-8700-B37375ED8B34@microsoft.com...
> Dear sirs
> I've created in my Form some objects (Buttons) at run time,
> the question is: how can I handle their events (Like: Click Event) at run
time
>
> best regards
> thanks
> Mohammed Abdel-Razzak