开发者

Popup window / message for remaining time

I have several froms in my a开发者_如何学Cpplication. When application starts, a timer starts for 30 minutes. I want to show the remaining time using a popup window, message or whatever, on whichever form the user is at that time.

Please advise how to do it.

Thanks Furqan


The timer objects in the .net framework do not give access to the time already elapsed or remaining.

However when your application starts you will can create and start a stop watch.

private _sw as System.Diagnostics.Stopwatch = System.Diagnostics.Stopwatch.StartNew()

At any time you can then call the following code which you can subtract from your 30 minutes

_sw.Elapsed.TotalSeconds

To show this time constantly on a form you may need a second timer to update the screen that queries this value.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜