Home All Groups Group Topic Archive Search About

Maintaining a response user interface

Author
20 Jan 2006 3:34 PM
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?

Author
20 Jan 2006 3:49 PM
Armin Zingler
Show quote Hide quote
"Marina" <someone@nospam.com> schrieb
> 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
Author
20 Jan 2006 4:09 PM
Ken Halter
Show quote Hide quote
"Marina" <someone@nospam.com> wrote in message
news:%23kj%23McdHGHA.1132@TK2MSFTNGP10.phx.gbl...
> 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.

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
Author
20 Jan 2006 4:17 PM
Cor Ligthert [MVP]
Marina,

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

Textbox1.show

Cor
Author
20 Jan 2006 5:00 PM
Marina
Thanks everyone, I had a feeling disabling all the controls was the way to
go.

Show quoteHide quote
"Marina" <someone@nospam.com> wrote in message
news:%23kj%23McdHGHA.1132@TK2MSFTNGP10.phx.gbl...
> 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?
>
Author
21 Jan 2006 1:05 AM
Dennis
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.
--
Dennis in Houston


Show quoteHide quote
"Marina" wrote:

> Thanks everyone, I had a feeling disabling all the controls was the way to
> go.
>
> "Marina" <someone@nospam.com> wrote in message
> news:%23kj%23McdHGHA.1132@TK2MSFTNGP10.phx.gbl...
> > 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?
> >
>
>
>