I have a process that take some time to process data in formA.
While processing the data I wish to pop a "waitingform". The waiting
form have it's own thread and show the process advancing between 0 and
100%.There is a timer within the
Waitingform, on each tick the progress percentage is read and display,
also this reflect that
the program is still running. When the processing finish, the waiting
form just close.

I have done everything and it's work well except for one thing. I wish
the waiting form to be modal and own by the main form.

If I set the waitingform owner :

WaitingForm->Owner = FormA

The waitingform doesn't appear before the data process finish, the form
disappear as soon as it appear. If I dont set the owner, the
waitingform works as expected, but can be lost behind other windows,
and user may believe there is a problem when it's not.

I use multiple threads in my application. The data processing thread is
not the same as formA nor the same as the Waitingform.

Does someone have an idea how I can set the ownership of the waiting
form and still keep the behavior i wish? Thank you

Re: Problem with Waiting Form Owner by GM3TEN

GM3TEN
Tue May 09 13:03:57 CDT 2006

One potential solution to your problem is to set the "TopMost" property
of your form to true.

C#

myForm.TopMost = true;

-GM
http://nonspect.com


Re: Problem with Waiting Form Owner by esquif

esquif
Tue May 09 14:04:47 CDT 2006

I have already try the TopMost property.

But the problem stay the same as soon as I set the owner of the
waitingform, the waitingform refuse to show before the data have been
processed. TopMost or Not

It's like if something prevent the waitingform to appear. I look the
problem from every side I see and I don't find anything usefull yet.

Within the WaitingForm there is a timer and at every timer tick, the
waitingform read a share variable to know where the process is and to
redraw a progressbar. When there is an owner, the timer doesn't tick.
It's not the source of the problem, but I think it's part of it.

SL


Re: Problem with Waiting Form Owner by GM3TEN

GM3TEN
Tue May 09 14:29:33 CDT 2006

Maybe the following article will help you a bit? I'm not sure.

http://msdn.microsoft.com/msdnmag/issues/04/05/BasicInstincts/

If you would like to feel free to post the method where you invoke the
"WaitingForm" window and make the callbacks.

-GM
http://nonspect.com