如何每秒更改 texbox 的文本? [英] How can I change the text of a texbox in every second?

查看:23
本文介绍了如何每秒更改 texbox 的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 texbox,我想在 Windows Phone 7 中每秒更改它的内容.例如,我有一个 int 列表,我想显示它的第一个值.然后 1 秒后显示第二个值.

I have a texbox and I want to change it's content every second in Windows Phone 7.. For example I have an int list and I want to show it's first value.. then 1 second later the second value.

推荐答案

DispatcherTimer 正是您要找的:http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer%28v=vs.95%29.aspx

DispatcherTimer is what you're looking for: http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer%28v=vs.95%29.aspx

新建一个 DispatcherTimer 实例,设置为每秒打勾,并在回调函数中更新文本框.

Create a new instance of DispatcherTimer, set it to tick every second, and update the textbox in the callback function.

这篇关于如何每秒更改 texbox 的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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