How to prevent GUI blocking?

Posted by Kovu on Stack Overflow See other posts from Stack Overflow or by Kovu
Published on 2010-03-12T11:50:24Z Indexed on 2010/03/12 12:07 UTC
Read the original article Hit count: 169

Filed under:
|
|

Hi,

I have a timer that ticks every 3 seconds. If the timer found something a messagebox will show. Then the timer should wait 30 seconds, before he show again the messagebox (the user of course must have time to react).

How can I handle this?

I tried a Thread.Sleep(30000), but the GUI blocks of course.

My other Idea is a second timer that will be activated after the first ticks and reactivate the first timer in the tick-method.

So: t1 tick -> msg box -> after click -> t2 enable (30 sec tick) -> t2 tick, enable t1

But I think thats not a good idea, is there a better way?

© Stack Overflow or respective owner

Related posts about timer

Related posts about thread