在Windows应用程序中显示当前时间观看 [英] to show current time watch in windows application

查看:157
本文介绍了在Windows应用程序中显示当前时间观看的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hii..i我想在Windows应用程序的标签上添加手表..i无法管理当前系统时间的刷新时间...

hii..i want to add watch on label in windows application..i am unable to manage the refresh time with current system time...

推荐答案

onTick事件现在应用此代码,它将用作动态监视


lbl2.Text = DateTime.Now.ToLongTimeString();
onTick event apply this code now it will work as dynamic watch


lbl2.Text=DateTime.Now.ToLongTimeString();


使用具有OnTick事件的Timer对象.在这种情况下,您可以更新标签文本.确保间隔设置为1000(= 1秒)
use Timer object which has the OnTick event. In that event you can update your label text. Make sure the interval is set to 1000 (= 1 second)


这篇关于在Windows应用程序中显示当前时间观看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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