Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: rajesh kumar
  Where is rajesh kumar?
 patna
 India
 rajesh kumar
 Tags
Subject: RE: Run Time Code
Thread ID: 249159 Message ID: 249230 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Projects and Design
Date: Wednesday, December 30, 2009 5:12:11 PM         
   


> Dear Foxperts,
> Is it possible to write some line of text(Program Code) at run time in any specifyed/all method of the form or object.
>
> Any help will highly appreciated.
>
> Thanks in Advance.
> Rajesh kumar
> KSPL Patna

There as a discussion bout this in
https://www.foxite.com/archives/add-eventcode-to-new-objects-at-runtime-0000216016.htm

In that case, as was revealed later in the thread, it wasd question of adding a number of pages to a pageframe, that number to be determined by circumstances at runtime. That's easy enough except if you want some, identical, event code in a Mousedown event on each new page added.
The solution was easy though; write the code in a Container class with the controls and Mousedown code needed; add this class to each page as the page was added:
With Thisform.PageFrame1
.PageCount=.PageCount+1
.Pages(.PageCount).AddObject('cnt1','MycontainerClass')
Endwith 


Could you use a solution based on a class?

-Anders

ENTIRE THREAD

Run Time Code Posted by rajesh kumar @ 12/29/2009 6:37:36 PM
RE: Run Time Code Posted by Vladimir Zografski @ 12/29/2009 6:54:18 PM
RE: Run Time Code Posted by Tony Vignone @ 12/29/2009 7:02:36 PM
RE: Run Time Code Posted by Cetin Basoz @ 12/29/2009 7:32:18 PM
RE: Run Time Code Posted by Anders Altberg @ 12/30/2009 5:12:11 PM
RE: Run Time Code Posted by rajesh kumar @ 1/2/2010 7:38:13 PM
RE: Run Time Code Posted by Stefan Wuebbe @ 1/3/2010 10:20:29 AM
RE: Run Time Code Posted by Anders Altberg @ 1/3/2010 4:19:01 PM
RE: Run Time Code Posted by rajesh kumar @ 1/7/2010 8:28:13 AM