Hi Claudio,
That's what I'm trying to avoid. I don't want to create a class for just one use. If I can't use a class at least twice, what's the point of creating it?
>Hi, Bill.
>
>>Do I have to sub-class the button so I can create the method? Is there some other way?
>
>the one way I see would be by using BindEvent - in VFP 8.
>
>You could create a class like:
>
>
>define class Whatever as session
>
>function HandleMyClick
>
> *-- do whatever you want the button's click should do.
>
>endfunc
>
>enddefine
>
>
>then you put this code somewhere (maybe on the Init of the button)
>
>
>oHandler = createobject("Whatever")
>BindEvent(This, "Click", oHandler, "HandleMyClick")
>
>
>HTH
Bill Morris