问题描述
我有一个 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 的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!