Maintaining a response user interface

  • Thread starter Thread starter Marina
  • Start date Start date
M

Marina

What is the right way to go about making sure an application is not frozen
and unresponsive while a relatively long running process is going on? The
process is making updates to the UI, which the user needs to see as they are
being made. However, it is desirable that the user is not able to actually
interact with the application as far as clicking buttons, etc, goes.

Application.DoEvents seems to update the UI nicely, but the user can still
interact with the form, which is not good. Is DoEvents the right way to go
here, and must all form elements that should not be interactive be disabled
for the duration of the process?

Any thoughts on this?
 
Marina said:
What is the right way to go about making sure an application is not
frozen and unresponsive while a relatively long running process is
going on? The process is making updates to the UI, which the user
needs to see as they are being made. However, it is desirable that
the user is not able to actually interact with the application as
far as clicking buttons, etc, goes.

Application.DoEvents seems to update the UI nicely, but the user can
still interact with the form, which is not good. Is DoEvents the
right way to go here, and must all form elements that should not be
interactive be disabled for the duration of the process?

Any thoughts on this?


I think, no matter if you are using doevents or a different thread executing
the process, in both cases, you will have to disable the buttons if you want
the user to be able to watch the process' output. This means, my suggestion
is to modify the UI in a way that only valid actions are possible during the
process. Watch out for the Form being closed, too.

Suggesting a modal Form to disable the usage of the Form is no good because
then the user wouldn't see the UI updates - unless the modal Form is used to
display the output of the process.


Armin
 
Marina said:
What is the right way to go about making sure an application is not frozen
and unresponsive while a relatively long running process is going on? The
process is making updates to the UI, which the user needs to see as they
are being made. However, it is desirable that the user is not able to
actually interact with the application as far as clicking buttons, etc,
goes.

Application.DoEvents seems to update the UI nicely, but the user can still
interact with the form, which is not good. Is DoEvents the right way to
go here, and must all form elements that should not be interactive be
disabled for the duration of the process?

Any thoughts on this?

If it were me, I'd disable all controls, show an hourglass mouse pointer,
run the "relatively long running process", reset the mouse pointer and
enable the controls. If that "relatively long running process" is longer
than a few seconds, I'd probably show some animation (or a progressbar if
the "% complete" information is available) while it's running.
 
Marina,

In my idea does just showing the control the job by painting it.

Textbox1.show

Cor
 
Thanks everyone, I had a feeling disabling all the controls was the way to
go.
 
I think I would try to show a modal form that contains my code to do the
updating with some kind of progress bar...when the updating is done, return
from the modal form. Disabling the controls results in sometimes dim fields
and screen flashing that is annoying.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top