如何使用计时器更改文本框? (Visual Studio 2016) [英] How do I use a timer to change a text box? (Visual studio 2016)

查看:84
本文介绍了如何使用计时器更改文本框? (Visual Studio 2016)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要我的计时器来更改文本框(30秒后,然后在10秒后再次更改。例如,用户检查一些框(复选框),然后显示他检查的文本框。例如,用户启动程序并且计时器开始运行,30秒后它会在文本框中显示一个复选框。当时间结束时,它显示以前由程序制造商编写的内容(但仅持续10秒) ,当它用完时,它会在文本框中再次显示不同复选框的内容。

任何人都可以帮助我吗?我不知道怎么开始。抱歉有问题。



我尝试了什么:



我不怎么样开始,我想要使用FOR,但我觉得它可能是一个IF。

解决方案

我假设您使用的是Winforms,那么最简单的选择是使用 System.Windows.Forms.Timer 请参阅此处的示例: Timer Class(System.Windows.Forms) [ ^ ]

你可以在代码中定义Timer,或者从工具箱中将一个定义到表单上。

有关定时器的更多信息:计时器 [ ^ ]

I need my timer to change a text box (after 30 seconds, and then to change again after 10 seconds. For example, the user checks some boxes (Check box), and then the one he checks are shown. For example, the user starts the program and the timer starts running, for 30 seconds it shows on the text box one of the check box. When the time ends, it shows something previously written by the maker of the program (but only for 10 seconds), and when that runs out, it shows again on the text box the contents of a different check box.
Can anyone help me? I'm not sure how to even start. Sorry for the trouble.

What I have tried:

I'm not how to start, i tought about using FOR, but i feel like it might be an IF.

解决方案

I assume you are using Winforms, then the easiest option is to use a System.Windows.Forms.Timer see example here: Timer Class (System.Windows.Forms)[^]
You can define the Timer in code, or drag one from the Toolbox onto your form.
More information on Timers here: Timers[^]


这篇关于如何使用计时器更改文本框? (Visual Studio 2016)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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