How to tell when all a form and all it's elements are done loading 
Author Message
 How to tell when all a form and all it's elements are done loading

I have wrote a program that when it's started, it downloads an xml file,
parses it comparing the hashvalues in that file with some files, and if they
are different downloads the new files.

My problem is that when the form first starts up, it has a couple of big
white blocks for a split second (where picturebox controls are), they go
away when the images replaces them.

I was thinking of morphing the form into a slightly smaller size with a
different panel that has a progress bar that gives a vague idea of the
progress of the loading of the form (a splash screen). Once all the other
panels are finished loading, then I can swap to one of the other panels, and
then begin program execution.

Anyone know how to accomplish that, or have any other ideas on how to make
it look a little better when starting up.  Sometimes by the time the form
shows, it has already downloaded and parsed the xml file, which means it
comes up with the download progress bar already at full, it looks ugly if
you don't know why it did that, and even if you did (IE: I have a label of
the progress bar that says filename & " downloaded succesfully"), it still
seems funky.

Any ideas?



Wed, 23 Nov 2005 02:34:01 GMT  
 How to tell when all a form and all it's elements are done loading
James,
I have not tried it, but you could handle the Loaded event?

Are you controlling the loading of the images, or are they part of the form.
If you control loading them, you could simply raise an event when they are
done loading.

Hope this helps
Jay


Quote:
> I have wrote a program that when it's started, it downloads an xml file,
> parses it comparing the hashvalues in that file with some files, and if
they
> are different downloads the new files.

> My problem is that when the form first starts up, it has a couple of big
> white blocks for a split second (where picturebox controls are), they go
> away when the images replaces them.

> I was thinking of morphing the form into a slightly smaller size with a
> different panel that has a progress bar that gives a vague idea of the
> progress of the loading of the form (a splash screen). Once all the other
> panels are finished loading, then I can swap to one of the other panels,
and
> then begin program execution.

> Anyone know how to accomplish that, or have any other ideas on how to make
> it look a little better when starting up.  Sometimes by the time the form
> shows, it has already downloaded and parsed the xml file, which means it
> comes up with the download progress bar already at full, it looks ugly if
> you don't know why it did that, and even if you did (IE: I have a label of
> the progress bar that says filename & " downloaded succesfully"), it still
> seems funky.

> Any ideas?



Wed, 23 Nov 2005 03:04:49 GMT  
 How to tell when all a form and all it's elements are done loading
I thought about doing something like this, but I kinda thought of it as a
hack.  What about if on some systems the images load very fast but some of
the other controls don't?

I think that what I might do is on the form load event, start a timer which
will check every  few ms if everything is loaded, if everything is loaded,
then I will show the form (I will leave it's visibility off by default).
That should be pretty full proof no matter what, and I can do a splash
screen before I enable the timer.

In the timer tick event, which checks if everything is loaded, I would have
a series of nested ifs, and everytime it gets passed an if (the control IS
loaded), it will increment the splash screen load indicator bar (but it it's
already been incremented for that  if(from a previous tick), then it won't
increment again).

I am still thinking about how to go about it.



Quote:
> James,
> I have not tried it, but you could handle the Loaded event?

> Are you controlling the loading of the images, or are they part of the
form.
> If you control loading them, you could simply raise an event when they are
> done loading.

> Hope this helps
> Jay



> > I have wrote a program that when it's started, it downloads an xml file,
> > parses it comparing the hashvalues in that file with some files, and if
> they
> > are different downloads the new files.

> > My problem is that when the form first starts up, it has a couple of big
> > white blocks for a split second (where picturebox controls are), they go
> > away when the images replaces them.

> > I was thinking of morphing the form into a slightly smaller size with a
> > different panel that has a progress bar that gives a vague idea of the
> > progress of the loading of the form (a splash screen). Once all the
other
> > panels are finished loading, then I can swap to one of the other panels,
> and
> > then begin program execution.

> > Anyone know how to accomplish that, or have any other ideas on how to
make
> > it look a little better when starting up.  Sometimes by the time the
form
> > shows, it has already downloaded and parsed the xml file, which means it
> > comes up with the download progress bar already at full, it looks ugly
if
> > you don't know why it did that, and even if you did (IE: I have a label
of
> > the progress bar that says filename & " downloaded succesfully"), it
still
> > seems funky.

> > Any ideas?



Wed, 23 Nov 2005 03:19:57 GMT  
 How to tell when all a form and all it's elements are done loading
The best way (that I know of) is to load your splah screen, sping the load
of data off onto a separate thread, what for the load to complete (thread
ends - use a Thread.Join to know when that was), then display the main
form.

HTH

David



Wed, 23 Nov 2005 04:43:45 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Please tell me what I am doing wrong - DAO parameter Append Query :(

2. Will somebody tell me what I am doing wrong with this ListView Control

3. tell another program i am done

4. How to tell if form is loaded from within form

5. out of memory when loading form with ADO element linked to table with >80000 records

6. how to tell if the active button from load event of new form

7. How to tell if a Form is Loaded?

8. How can I tell if form i already loaded

9. Tell if form is loaded

10. How to tell if a form been loaded

11. How to tell when form has fully loaded

12. Unloading or hiding a form in the form's load event

 

 
Powered by phpBB® Forum Software