Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Boudewijn Lutgerink
 To: Russell Hill
  Where is Russell Hill?
 Russell Hill
Subject: RE: PageFrames and speed
Thread ID: 22844 Message ID: 22881 # Views: 2 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Tuesday, April 29, 2003 11:55:01 AM         

> Hi all.
> I have a form with 14 pageframes, some of those pageframes with pageframes within them as well.
> The text boxes on each page of each pageframe have values given by a single table with 240 odd fields.
> To speed things up to begin with, I don't fill the text boxes until the user clicks on that particular page.
> This is because it was so slow when I filled them in the init event of the form and because the user may only click on a few pages in a single session.
> The problem of speed reappears when the user clicks on many pages in a single session, where the speed seems to slow down with each successive page.
> Is there any way to speed up this process or is that just the way it is?
> Thanks in advance.
> Russell.
This requires some extra work, but it might help.
The technique of delayed loading comes to mind here. The problem you describe was experienced by other before you.
What happens here is that the init of all the controls slows things down.

So, how does delayed loading work.
first off all, page by page except for the first page, select all the controls and save them as classes (set automatically to a container.) in a classlib.
remove all those controls from the pages.
Once a page is selected (clicked on) load the container onto that page.
Of course, once the container is on the page there is no need to reload it...

some code:
* init of the pageframe...
set classlib to MyPages.vcx additive

* in the activate of the page
IF NOT PemStatus( this, "oDataContainer",5)
	with this
		.addobject("oDataContainer", "DataContainer")
		.oDataContainer.left = 0
		.oDataContainer.top = 0
		.oDataContainer.height = this.height
		.oDataContainer.width = this.width


Boudewijn LutgeĀ®ink
He, who stands on his toes is not in balance. He, who straddles doesn't make progress.
Who wants to shine will not be enlightened...


PageFrames and speed Posted by Russell Hill @ 4/28/2003 9:11:59 AM
RE: PageFrames and speed Posted by Benny Thomas @ 4/29/2003 8:35:16 AM
RE: PageFrames and speed Posted by Boudewijn Lutgerink @ 4/29/2003 11:55:01 AM