Display Modal Form but Still Process from Parent Form?

  • Thread starter Thread starter josepk
  • Start date Start date
J

josepk

Hello,

Does anyone know if there is a way to display a form modally but still
allow processing to continue with the parent form that displayed the
modal form?

For example, assume I have Form A with various buttons on it and one of
the buttons on Form A kicks off a process that takes 5-10 seconds to
complete. I would like Form A to display a "Waiting..." modal Form B
but still have Form A continue processing while Form B is being
displayed.

Having Form B appear solves two issues:
1) Let's the user know that processing is under way (little more
informative than an hourglass cursor).
2) Prevents me from having to disable controls on Form A until the
processing is completed (I don't want the user to press controls on
Form A which could interrupt the processing).

Thanks,

Joe
 
How does the modal form close? What if the user closes it before your
processing is done? I guess you close it when the long processing is done...

Basically you need to put the long processing in a thread... You could show
a panel with your progressbar and other descriptive text while the task is
not complete. The panel can cover all your other UI elements if you don't
want to explicitly disable them (what is wrong with that by the way?).

Take a look at the BackgroundWorker:
http://www.danielmoth.com/Blog/2004/12/backgroundworker-for-cf-10.html

Cheers
Daniel
 
Isn't it obvious from the blog entry I pointed you too?!

The first paragraph:
" .NET 2.0 makes threading easier by offering a BackgroundWorker class (not
sure if CF 2.0 will have it, though). Read on to find out how to take
advantage of it today in the CF 1.0 (also works on the desktop .NET 1.1)."

Near the end:
"Download the DLL here (works on all platforms/versions) "

Also check out the sample here:
http://www.danielmoth.com/Blog/2004/12/backgroundworker-sample.html

If you are already using OpenNETCF it will be part of version 1.3
http://www.opennetcf.org/SourceBrow.../OpenNETCF/ComponentModel/BackgroundWorker.cs

Cheers
Daniel
 
Back
Top