By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,695 Members | 1,221 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,695 IT Pros & Developers. It's quick & easy.

Modeless Dialog Not Responding

P: n/a
The scenario is this:

My UI thread creates a worker thread that performs some tasks and
periodically updates the screen. All well and good, as it does this by the
usual Invoke mechanism. If I want to stop the background process, I can
click a button on the toolbar to stop it, as the UI is nice and responsive.

At some point, the worker thread becomes idle, waiting for an external
(non-user) event. At this time, I want a modeless dialog to appear, with a
message inviting the user to halt the task if required. The dialog just
contains a message and a stop button.

The problem is, when I display the dialog, it does not refresh, so does not
draw fully, and no amount of clicking on the button has any effect.

My toolbar buttons still respond, so why doesn't my dialog button do
anything?

I suppose I could stick a DoEvents somewhere, but I have an instinctive
dislike of this as a solution, as it seems to me that it frequently hides
the real problem, and possibly hides bad design.

Any and all suggestions welcome.

TIA

Charles
Feb 6 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Which thread are you displaying the dialog on? The worker thread or the
main form thread?

- NuTcAsE

Feb 6 '06 #2

P: n/a
The dialog is created from the worker thread, but if there is a way for the
worker thread to create the dialog on the UI thread then that would be good.

Charles
"NuTcAsE" <ra********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Which thread are you displaying the dialog on? The worker thread or the
main form thread?

- NuTcAsE

Feb 6 '06 #3

P: 1
ccm
Charles, did you find out a solution for this problem? Thanks.


The dialog is created from the worker thread, but if there is a way for the
worker thread to create the dialog on the UI thread then that would be good.

Charles


"NuTcAsE" <rao.ritesh@gmail.com> wrote in message
news:1139258205.854253.202530@z14g2000cwz.googlegr oups.com...[color=blue]
> Which thread are you displaying the dialog on? The worker thread or the
> main form thread?
>
> - NuTcAsE
>[/color]
Mar 17 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.