动态数字时钟 [英] dynamic digital clock

查看:196
本文介绍了动态数字时钟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建动态数字时钟?

i使用这种逻辑

 lbltime.text = datetime.now.tostring (); 





但它没有给我显示时间和秒的变化&分钟



Thnx in Advance ..

解决方案

简单的数字时钟 [ ^ ]

一个WPF数字时钟 [ ^ ]

使用.NET的多用途数字时钟控制 [ ^ ]


如果你在windows窗体的情况下尝试这个,那么它会比你想象的更容易.Pick 计时器控制您的表单然后右键单击它,你会找到属性。在事件标签上你会找到你需要使用的 tick 事件。然后代码就像......

< pre lang =c#> private void timer1_Tick( object sender,EventArgs e)
{
label1.Text = DateTime.Now.ToString( hh:mm:ss tt);
}



看到你的时钟已准备就绪!有一件事需要提及,你会在定时器的属性中找到间隔选项控制你可以在哪里改变你的时钟间隔。

快乐编码.. :)


How to create a dynamic digital clock ??
i use this kind of logic

lbltime.text = datetime.now.tostring();



but it woudn''t showing me time with changes in seconds & minutes

Thnx in Advance..

解决方案

Simple digital clock[^]
A WPF Digital Clock[^]
Multipurpose Digital Clock Control using .NET[^]


If you try this in case of windows form then it would be easier than what you think.Pick Timer control on your form.Then right click on it,you will find properties.At the event tag you will find tick event which you need to use.Then code just like as..

private void timer1_Tick(object sender, EventArgs e)
{
    label1.Text = DateTime.Now.ToString("hh:mm:ss tt");
}


And see your clock is ready to operate!One thing need to mention here,you will find interval option in the properties of timer control where you can change interval of your clock.
Happy Coding..:)


这篇关于动态数字时钟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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