表格上显示系统运行时间 [英] System running time display on form

查看:82
本文介绍了表格上显示系统运行时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想在用户表单的顶部显示正在运行的系统时间,以便他们输入数据.请指导...

Hi, I want to display the running system time on the top of the user form where they will enter the data. please guide...

推荐答案

您是否正在使用Winforms?如果是,则在表格上放置label timer .将超时设置为1秒,然后在tick 事件中使用datetime object将标签文本设置为当前时间.

如果是网络表单,请使用javascript时间对象与Setinterval settimeout 函数结合使用.
Are you using winforms? If yes then put a label and timer on form. set the timeout to 1 second and then in the tick event set the labels text to the current time using datetime object.

in case of webforms: use javascript time object in conjunction with Setinterval or settimeout function to do the same.


in form u can take one label
in code behind u can write like this.
label1.Text = DateTime.Now.ToString();


亲爱的您可以使用Datetime Function设置系统的日期时间.
字符串s = System.Convert.ToString(DateTime.Now);
Dear you can use Datetime Function to set the datetime of System.

String s=System.Convert.ToString(DateTime.Now);


这篇关于表格上显示系统运行时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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