Help with multiple forms functionality

J

John Cosmas

We have a unique situation where we need to speed up the activation of our
MAIN form. We have put a splash page before the main shows up and we
pre-load most of our stuff (user profiles). Then we bring up the MAIN
form, but we need to continue loading our other stuff (data sets, list). We
want to do while inside the SPLASH, but minimize it and let the MAIN form
come up as fast and quickly as possible. At this point, we'll HIDE the
SPLASH page and just continue loading items in it. Does this involve
multi-threading, and if so, where can I read up on this?
 
R

Robbe Morris [C# MVP]

I'd search google on: .NET Forms and threading
There are some good articles out there for just
what you are wanting to do.

--
Robbe Morris - 2004/2005 Microsoft MVP C#

Earn money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp
 
G

Guest

yeah, one way would be to kick off a worker thread in the splash form, then
let control resume to main window. problem is if any "initialisation data" is
required by main form, you'd need to prevent user performing certain actions
until you hear back from thread.
There's a decent article on code project about using a timer to poll the
thread.

HTH
Sam
 
M

Metallikanz!

I would suggest you wrap the method used for loading your settings and stuff in a delegate and call it asynchronously using the BeginInvoke() method. After this you can proceed to load your main form, once that's done you can call the EndInvoke() method which's a blocking call and will return once all your settings are loaded. Asynchronous delegate invocation internally uses threads and stuff (ThreadPool actually) but then you wouldn't have to get your hands dirty doing it while the FW takes care of it for you.

HTH, Metallikanz!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top