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


> > I am creating a number of text Boxes at run time using "AddOBJECT". Each Textbox has a different name. How do I dynamically add a few lines of code to the click event of each textbox. The code will be different fof each textbox and may many lnes of code. Can I do that? Please give me an example.
> >
> > Thanks in advance;
> >
> > Paul D'Anna
>
> 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

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