是否有适用于 Windows Phone 7 的计时器控件? [英] Is there a timer control for Windows Phone 7?

查看:19
本文介绍了是否有适用于 Windows Phone 7 的计时器控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次尝试编写一个 win phone 7 应用程序 - 是否有类似于 winforms 的计时器控件?或者有没有办法获得这种类型的功能?

I'm trying to write a win phone 7 app for the first time - is there a timer control similar to the one for winforms? Or is there a way to get that type of functionality?

推荐答案

您可以使用 System.Windows.Threading.DispatcherTimer.

You can use System.Windows.Threading.DispatcherTimer.

System.Windows.Threading.DispatcherTimer dt = new System.Windows.Threading.DispatcherTimer();
dt.Interval = new TimeSpan(0, 0, 0, 0, 500); // 500 Milliseconds
dt.Tick += new EventHandler(dt_Tick);
dt.Start();

void dt_Tick(object sender, EventArgs e)
{
        // Do Stuff here.
}

这篇关于是否有适用于 Windows Phone 7 的计时器控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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