Common Dialog Stops Timer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that has a timer running on it (System.Timers.Timer). On this form, I have a button that opens a Common Dialog box. As soon as this button is pressed, the timer stops running. When I return and close the common dialog, the timer will not start up again, no matter what I do. If I stop the timer before the box is displayed, and then try to start it afterwards (timer.start), it still doesn't work. I don't need to respond to events when the dialog is open, I just want the timer to resume when the dialog is closed.

How can I do this?

Thanks a bunch,

Adam
 
Sounds like a buglet to me - in the common dialog control.

Adam said:
I have a form that has a timer running on it (System.Timers.Timer). On
this form, I have a button that opens a Common Dialog box. As soon as this
button is pressed, the timer stops running. When I return and close the
common dialog, the timer will not start up again, no matter what I do. If I
stop the timer before the box is displayed, and then try to start it
afterwards (timer.start), it still doesn't work. I don't need to respond to
events when the dialog is open, I just want the timer to resume when the
dialog is closed.
 
* "=?Utf-8?B?QWRhbQ==?= said:
I have a form that has a timer running on it (System.Timers.Timer). On this form, I have a button that opens a Common Dialog box. As soon as this button is pressed, the timer stops running. When I return and close the common dialog, the timer will not start up again, no matter what I do. If I stop the timer before the box is displayed, and then try to start it afterwards (timer.start), it still doesn't work. I don't need to respond to events when the dialog is open, I just want the timer to resume when the dialog is closed.

Are you using the .NET "common dialogs" or the old Common Dialogs
ActiveX component?
 
I am using the one in the VS.NET 2003 toolbox, by dragging and dropping onto my form. Any other ideas/help?

Thanks,

Adam
 
Hi Adam,

I was just saying in a different thread that there are three set of Timers
that you can use. (And Cor says I mised some!!) Anyway. Why not use one of the
others.

Forms.Timer is the familiar drag-n-drop one.

System.Timers.Timer is one that can be used without a Form. It's
similar in use in that it raises an Event to which a class in your app
subscribes.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/fr
lrfsystemtimerstimerclassctortopic.asp

System.Threading.Timer is one which you provide a callback method.
When the Timer goes off, this method is called in its own Thread.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/fr
lrfsystemthreadingtimerclassctortopic2.asp

There's a (typically MSDN) example given with each.

Regards,
Fergus
 
Back
Top