470,591 Members | 1,788 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,591 developers. It's quick & easy.

"Preload" Forms for speed?

Hi!
Is there a way to "preload" a form using a thread or something else so that
my user doesn't have to wait 5 seconds (initializing time) between forms?
Some of these forms have tab strips with lots of controls and database
queries on them and I would like to try to have some(all) of the preloading
of the next form and controls done in the background while a user is still
entering data.

(For example, my user visits screen A then B then C. While the user is
still viewing/entering data on screen A, I would like form B to preload in
the background. The user clicks "next" or whatever on form A and form B is
then displayed. form C would then begin preloading...and so on.)

Does anyone have any suggestions or advice on what I could do to increase
speed between forms? Is my form flow plan OK? BTW - I'm using VB.NET on
Compact Framework, but I'll gladly accept *any* advice and direction.

Thanks!
--Scott


Nov 20 '05 #1
4 9593
Scott,

Yeah you can pre-load forms (after all they are classes). However, I don't
know how much of a speed increase you'll get (never tested it).

second off all, I am not sure on the Compact Framework as I have never used
that before. What you may want to do is looking up the
System.Threading.Thread class on your help cd and see if its supported byt
he compact framework, or find something that is.

Hope it helps,
CJ
"Scott Johnson" <sjohnson_at_softaltern_dot_comDIESPAM> wrote in message
news:vv************@corp.supernews.com...
Hi!
Is there a way to "preload" a form using a thread or something else so that my user doesn't have to wait 5 seconds (initializing time) between forms?
Some of these forms have tab strips with lots of controls and database
queries on them and I would like to try to have some(all) of the preloading of the next form and controls done in the background while a user is still
entering data.

(For example, my user visits screen A then B then C. While the user is
still viewing/entering data on screen A, I would like form B to preload in
the background. The user clicks "next" or whatever on form A and form B is then displayed. form C would then begin preloading...and so on.)

Does anyone have any suggestions or advice on what I could do to increase
speed between forms? Is my form flow plan OK? BTW - I'm using VB.NET on
Compact Framework, but I'll gladly accept *any* advice and direction.

Thanks!
--Scott

Nov 20 '05 #2
At the loading of the main for, declare and initialize an instance of each
form you want either within the main form or create a class with a shared
property for each form. - this will slow loading up but you'll have them all
in memory. Then you can make the forms visible as necessary depending on
what the user wants to do. If you bind them to the main form, you'll have
limited access to everything from the subsequent forms, so you'll probably
want to use a module or create the forms as shard properties of a class.

This link may also be of help...in the CF, you need to squeeze out every lit
bit of efficiency you can
http://msdn.microsoft.com/library/de...rmloadperf.asp

HTH,

Bill
"Scott Johnson" <sjohnson_at_softaltern_dot_comDIESPAM> wrote in message
news:vv************@corp.supernews.com...
Hi!
Is there a way to "preload" a form using a thread or something else so that my user doesn't have to wait 5 seconds (initializing time) between forms?
Some of these forms have tab strips with lots of controls and database
queries on them and I would like to try to have some(all) of the preloading of the next form and controls done in the background while a user is still
entering data.

(For example, my user visits screen A then B then C. While the user is
still viewing/entering data on screen A, I would like form B to preload in
the background. The user clicks "next" or whatever on form A and form B is then displayed. form C would then begin preloading...and so on.)

Does anyone have any suggestions or advice on what I could do to increase
speed between forms? Is my form flow plan OK? BTW - I'm using VB.NET on
Compact Framework, but I'll gladly accept *any* advice and direction.

Thanks!
--Scott

Nov 20 '05 #3
My experiences with "speeding up" forms has taught me to
think like a magician. After all, if the
user "perceives" that a form is loading quickly, or
is "responsive" than it doesn't really matter if it
really is taking 5 seconds to initialize. One trick I
use is "amortizing" the long operations. That is, if it
takes 20 seconds to get a result from a database query,
but, you don't need to display everything from the query,
then break up the query into smaller chunks and display
each chunk as it becomes available. So if it takes 3
seconds to get your first result, then 7 seconds for the
second result and then 10 seconds for your final result,
if you start by displaying the first result in 3 seconds
your gui will seem faster (even though 3 + 7 + 10 = the
original 20 seconds--the user only had to wait 3 seconds
for the gui to display a result). It's all "smoke and
mirrors". When it comes to initializing multiple windows
(or tabs) you can "spread out the pain" by starting the
initialization of the longer running operations first.
Using multiple threads can help with the "amortization"
of the initialization of your multiple windows (or tabs)
but you must take the extra precaution of "synchronizing"
the various threads so that your "main window" thread
doesn't display a partially initialized view. You must
also handle the case where your main thread gets
terminated before the "secondary" threads get an
opportunity to complete. After all, you don't want to
write to a window that has been closed!
-----Original Message-----
Hi!
Is there a way to "preload" a form using a thread or something else so thatmy user doesn't have to wait 5 seconds (initializing time) between forms?Some of these forms have tab strips with lots of controls and databasequeries on them and I would like to try to have some (all) of the preloadingof the next form and controls done in the background while a user is stillentering data.

(For example, my user visits screen A then B then C. While the user isstill viewing/entering data on screen A, I would like form B to preload inthe background. The user clicks "next" or whatever on form A and form B isthen displayed. form C would then begin preloading...and so on.)
Does anyone have any suggestions or advice on what I could do to increasespeed between forms? Is my form flow plan OK? BTW - I'm using VB.NET onCompact Framework, but I'll gladly accept *any* advice and direction.
Thanks!
--Scott


.

Nov 20 '05 #4
Thanks for the replies! I'll give em a try.
"Scott Johnson" <sjohnson_at_softaltern_dot_comDIESPAM> wrote in message
news:vv************@corp.supernews.com...
Hi!
Is there a way to "preload" a form using a thread or something else so that my user doesn't have to wait 5 seconds (initializing time) between forms?
Some of these forms have tab strips with lots of controls and database
queries on them and I would like to try to have some(all) of the preloading of the next form and controls done in the background while a user is still
entering data.

(For example, my user visits screen A then B then C. While the user is
still viewing/entering data on screen A, I would like form B to preload in
the background. The user clicks "next" or whatever on form A and form B is then displayed. form C would then begin preloading...and so on.)

Does anyone have any suggestions or advice on what I could do to increase
speed between forms? Is my form flow plan OK? BTW - I'm using VB.NET on
Compact Framework, but I'll gladly accept *any* advice and direction.

Thanks!
--Scott

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Bob | last post: by
1 post views Thread by Stacey | last post: by
2 posts views Thread by ChInKPoInt [No MCSD] | last post: by
1 post views Thread by mmcc128 | last post: by
4 posts views Thread by Robert Cramer | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.