form 'freezes'

E

Erivis

Hi all,

During a timeconsuming action I like to present a form with a progressbar,
so the user knows someting is going on.
My problem now is that if an user set focus on the form, the caption bar
says: 'xxx does not respond' and the progressbar freezes. The process
however continues without problems.
This must be something trivial, but I cannot find anything that solves this.
Any suggestions?

tia,

Erik
 
E

Erivis

Hi Bjørn,
Thanks for your suggestion.

Erik

Bjørn Brox said:
Erivis skrev:
Classical error: You perform the heavy job the main thread, which means
that the form is blocked until the heavy job is complete.

Move it to another thread which reports the progress back to the main
thread.
 
A

Arne Vajhøj

During a timeconsuming action I like to present a form with a
progressbar, so the user knows someting is going on.
My problem now is that if an user set focus on the form, the caption bar
says: 'xxx does not respond' and the progressbar freezes. The process
however continues without problems.
This must be something trivial, but I cannot find anything that solves
this. Any suggestions?

Just start a new thread to do the work and update the progress bar
via invoke.

Arne
 
E

Erivis

Arne
Try and see how many hits Google gives on

you must refer to this:
Q: DoEvents is evil?

A: Glenn (Microsoft) Yielding on the UI thread is a legitimate Windows
programming practice. It always has been. DoEvents makes it easy, because
the situations in which you need to use it are simple

<g>

Erik
 
A

Arne Vajhøj

you must refer to this:
Q: DoEvents is evil?

A: Glenn (Microsoft) Yielding on the UI thread is a legitimate Windows
programming practice. It always has been. DoEvents makes it easy,
because the situations in which you need to use it are simple

<g>

That extract is not the typical opinion on the topic.

Arne
 

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

Top