Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jignesh Parekh
  Where is Jignesh Parekh?
 Rajkot
 India
 Jignesh Parekh
 To: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 Tags
Subject: RE: BINDEVENT()
Thread ID: 288825 Message ID: 288835 # Views: 25 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Classes and Objects
Date: Friday, December 24, 2010 1:20:05 PM         
   


> > Hi All,
> >
> > I have a form and add Command Button at run time and Bind their Click event to my custom event, this run fine but how can I know in my custom event that which button was clicked?
> >
> > Regards,
> > Jignesh Parekh
> > --------------------------------------------------------------------------------------------------------------------------------
> > If better is possible, Good is not enough.
>
> Check the AEVENTS function.
>
> =AEVENTS(laEvent,0)
> laEvent[1] will give the source
>
> Regards
> Tushar

Thanks Tushar, it worked. Can I ask one more Question, I have all command button in an array, can you tell me how to get number of clicked button?

Update:
Problem Solved with following
=AEVENTS(laEvent,0)

xNo = 1
FOR EACH oBut IN Thisform.oButArra
	IF oBut.Caption = laEvent[1].CAPTION
		EXIT
	ENDIF
	xNo = xNo + 1
ENDFOR

=MESSAGEBOX("Custom Event Fired : "+laEvent[1].CAPTION)
=MESSAGEBOX(xno)


Regards,
Jignesh Parekh
--------------------------------------------------------------------------------------------------------------------------------
If better is possible, Good is not enough.

ENTIRE THREAD

BINDEVENT() Posted by Jignesh Parekh @ 12/24/2010 12:46:09 PM
RE: BINDEVENT() Posted by tushar @ 12/24/2010 12:57:16 PM
RE: BINDEVENT() Posted by Jignesh Parekh @ 12/24/2010 1:20:05 PM
RE: BINDEVENT() Posted by Bhushan Sahni @ 12/24/2010 1:08:48 PM
RE: BINDEVENT() Posted by Jignesh Parekh @ 12/24/2010 1:21:44 PM