状态栏中的在线时间代码是什么? [英] what is the code for online time in status strip?

查看:70
本文介绍了状态栏中的在线时间代码是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

状态栏中的在线时间代码是什么?

解决方案

答案是在线时间". br/>
但基本上,您将使用计时器每1/10/20 ....秒触发一次(您的选择),检索在线时间",然后修改内置状态条控件之一的text属性. br/>
关于状态栏中显示时间的文章很多.


自从我最后一个回答以来,我一直在思考您的问题,但我发现您可能想花点时间在网上.


br/>
如果是这样,我的上一个答案基本上是正确的,您需要做的就是在应用程序启动时将当前时间存储在DateTime类型的变量中.然后,每次前面提到的计时器触发时,获取当前时间并从中减去存储的时间.结果是经过的时间,您可以在StatusStrip中显示它.


what is the code for online time in status strip?

解决方案

The answer to this will depend on what you mean by ''online time''.

But basically you would use a timer to fire every 1/10/20.... seconds (your choice), retrieve the ''online time'' and then modify the text property of one of the built in status strip controls.

There are loads of articles about displaying time in a status strip. Either search here on CP or use one of the search engines.


Since my last answer I have been thinking about your question and it occurred to me that you might have meant time spent online.

If that is so, my previous answer is basically correct all that you need to do is When your application starts store the current time in a variable of the DateTime type. Then every time the Timer, mentioned previously, fires, get the current time and subtract the stored time from it. The result is the elapsed time and you can display that in the StatusStrip.


这篇关于状态栏中的在线时间代码是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆