Hi,
I have a rather peculiar problem.
I have a 'view'
library which loads and saves the users last view settings, i.e. how
the application looked when the user was last using the system. I store
these view properties in xml. no problem there.
It does
however take a while to load and save a view as there is a lot of
validation occurring which slows the load/save down considerably, this
is just because of the sheer quantity of information. This leads to
the program appearing to freeze for a few seconds, this is bad.
To combat this, what I am trying to do is make a progress dialog
containing a progress bar appear when views are being loaded or saved.
I just want to show an indication of the system working to the user, as
there is no defined limit to the loading and saving operation.
Therefore I have decided to use a marquee style progress bar.
In order to get the progressbar to draw and not to freeze (like the
rest of the application) I originally tried moving the load/save view
into another thread, but soon found this is not possible as the
load/save was unable to set properties on gui components which were not
created within it's own thread.
I then tried to put the
progress bar in a seperate thread and display it in the centre of the
screen, but it does not appear (Possibly because it is in a seperate
thread).
Any help with this situation would be much appreciated.
Cheers
Alex
Loading
Alex HaywardPosted Apr 8, 2009, 4:03 AM
Thanks for all you suggestions.
I got it to work a different way.
Jan MontanoPosted Apr 7, 2009, 11:01 PM
Here's a sample to get you started. Try the code by nobugz.
LisaPosted Apr 7, 2009, 8:31 AM
putting it in two different threads sounds logical , but guess you need to call both those threads in a single function such that one thread(the progress bar) runs when actually the first thread is started till the components are created.
Hope it Helps,
Thanks,
Lisa