V
Viking2000
Hi I hope I have the right group for this.
I have an MDI form, and some of the child forms take awhile to load
because they are data heavy. I want to display a Progressbar so that
the user has an idea that something is still happening. I know the
average time for loading for each form, so I can make the ProgressBar
fairly accurate. Also each child form can be written by a different
group so I need to keep the amount of special code they implement to a
minimum,
I know this requires threading but I am running into some issues.
1) Loading the Child Form in the main thread, calling ProgressBar
update in another thread. It appears that all screen updates only
happen in the main thread, so all the screen updates get queued, until
the form is completed, so this does not give any useful display.
2) Load the child form in another thread, keeping the main thread
unencumbered to do things like screen updates. This works pretty well
except that I can not attach the child form to the MWI Parent because
it is owned by a different thread at this point.
So my problem is the child form must load in the main thread, all
screen updates must happen in the main thread. How do I interrupt the
main thread while loading so that I can force screen updates? Or am I
taking the wrong path, and is there another method I should be looking
into?
Thank you
I have an MDI form, and some of the child forms take awhile to load
because they are data heavy. I want to display a Progressbar so that
the user has an idea that something is still happening. I know the
average time for loading for each form, so I can make the ProgressBar
fairly accurate. Also each child form can be written by a different
group so I need to keep the amount of special code they implement to a
minimum,
I know this requires threading but I am running into some issues.
1) Loading the Child Form in the main thread, calling ProgressBar
update in another thread. It appears that all screen updates only
happen in the main thread, so all the screen updates get queued, until
the form is completed, so this does not give any useful display.
2) Load the child form in another thread, keeping the main thread
unencumbered to do things like screen updates. This works pretty well
except that I can not attach the child form to the MWI Parent because
it is owned by a different thread at this point.
So my problem is the child form must load in the main thread, all
screen updates must happen in the main thread. How do I interrupt the
main thread while loading so that I can force screen updates? Or am I
taking the wrong path, and is there another method I should be looking
into?
Thank you