Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 To: Paul D'Anna
  Where is Paul D'Anna?
 Metairie
 Louisiana - United States
 Paul D'Anna
 Tags
Subject: RE: Run time Code
Thread ID: 143212 Message ID: 143239 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Sunday, August 26, 2007 3:27:41 PM         
   


> >
> > Paul
> >
> > For examples search the archives for BINDEVENT.
> >
> > Regards
> > Tushar
>
> I created a method named "MYCLICK". It contains the following code.
> > WAIT WINDOW "Value = "+STR(This.Value) NOWAIT
>
> I dynamically created 81 Text Boxes in "THISFORM.ACTIVATE" with names TEXT01 through TEXT81. I would like to bind the CLICK event of each Text Box to the "MYCLICK" method. Below is thecode I used, but it didn't work.
>
>
>
> >TotalNumberOfSquares = 81
>
> >FOR I = 1 TO TotalNumberOfSquares
> >Suffix = ALLTRIM(STR(I))
> >
> >IF LEN(Suffix) = 1
> >Suffix = "0"+Suffix
> >ENDIF
>
> >TextName = "Text"+Suffix && The Text Box Name
>
> >SquareName = "ThisForm."+TextName && The Object Name
>
> >BINDEVENT(&Squarename,"CLICK",Thisform.Myclick,0)
>
> >NexT I

Paul

Try

BINDEVENT(&Squarename,"CLICK",Thisform,"Myclick",0)

Your second option is to use class


DEFINE CLASS MyTextBox AS textbox

PROCEDURE Click
parent.myclick
ENDPROC


ENDDEFINE


Then add this instead of the standard textbox.

Regards
Tushar

ENTIRE THREAD

Run time Code Posted by Paul D'Anna @ 8/26/2007 5:21:49 AM
RE: Run time Code Posted by tushar @ 8/26/2007 8:05:45 AM
RE: Run time Code Posted by Paul D'Anna @ 8/26/2007 12:41:10 PM
RE: Run time Code Posted by tushar @ 8/26/2007 3:27:41 PM
RE: Run time Code Posted by Mike Yearwood @ 8/26/2007 9:05:58 PM
RE: Run time Code Posted by Cetin Basoz @ 8/27/2007 11:58:03 AM
RE: Run time Code Posted by tushar @ 8/27/2007 12:21:07 PM
RE: Run time Code Posted by Cetin Basoz @ 8/27/2007 12:59:11 PM