Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Steven Rebello
  Where is Steven Rebello?
 Bangalore
 India
 Steven Rebello
 To: mike castillo
  Where is mike castillo?
 Joo Seng Road, Singapore
 Philippines
 mike castillo
 Tags
Subject: RE: BindEvents
Thread ID: 188512 Message ID: 189040 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Wednesday, August 13, 2008 4:30:13 AM         
   


> > Hi all,
> >
> > I am not very clear as to how to use "BindEvents". Help has not been too helpful to a mid-level programmer like me. Can anyone give me any easy answer?
> >
> > Regards,
> >
> > Steve
>
> I will explain based from what I understand:
>
> BINDEVENT(oEventSource, cEvent, oEventHandler, cDelegate)
>
> oEventSource - the object which will be bind to the handler
> cEvent - the event of the object which will be bind to the handler
> oEventHandler - the object that will handle the event requested from the event source
> cDelegate - the event that will handle the event requested from the event source
>
> So meaning if you have something like this:
>
> Declared in the INIT of The form:
>
> BINDEVENT(Thisform.command1,"Click",Thisform,"BtnClick")
> 

>
> so everytime you click the command1 button, whatever you have in the custom event which is the BtnClick event will be triggered.
>
> Bindevent is useful especially if you have many buttons that has thesame functionality.
>
> Thus another trick would be from the above sample is that:
>
> Thisform.BtnClick Event:
>
>
> AEVENTS(laObjects,0)
> loEventSource = laObjects(1)
> messagebox(loEventSource.NAME)
> 

> From the above sample you can detect which button fires the event.
>
> Hope this helps

Hi Mike,

Thanks, for your explanation and examples which helped me to understand bindevents even further!

With best regards,

Steve.

ENTIRE THREAD

BindEvents Posted by Steven Rebello @ 8/10/2008 8:29:01 AM
RE: BindEvents Posted by Koen Piller @ 8/10/2008 9:07:35 AM
RE: BindEvents Posted by surinder singh @ 8/10/2008 10:13:57 AM
RE: BindEvents Posted by Yousfi Benameur @ 8/10/2008 11:17:48 AM
RE: BindEvents Posted by ho me @ 8/11/2008 12:46:53 PM
RE: BindEvents Posted by Steven Rebello @ 8/13/2008 4:26:02 AM
RE: BindEvents Posted by ho me @ 8/13/2008 8:40:15 AM
RE: BindEvents Posted by mike castillo @ 8/12/2008 7:14:03 AM
RE: BindEvents Posted by Steven Rebello @ 8/13/2008 4:30:13 AM
RE: BindEvents Posted by mike castillo @ 8/13/2008 4:55:52 AM