如何创建向用户显示的倒数计时器? [英] How to create a countdown timer that is displayed to the user?

查看:128
本文介绍了如何创建向用户显示的倒数计时器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个计时器,显示从10分钟开始的倒计时,但我不确定如何做到这一点.我希望它显示分钟和秒.我对Visual Basic还是很陌生,所以任何帮助都会很棒.

[edit]仅标记-OriginalGriff [/edit]

I want to have a timer that displays a countdown from 10 minutes but I''m not entirely sure how to do it. I''d like it to display minutes and seconds. I''m still new to visual basic so any help would be great.

[edit]Tags only - OriginalGriff[/edit]

推荐答案

转到那里 [ ^ ]阅读文章如何在Visual Basic中使倒数计时器".它可能会帮助您操纵程序
Go there[^] to read an article "How to Make a countdown timer in Visual Basic". it might help you to manipulate your program


您好,
不给您一个适合所有解决方案的尺寸.

.Net框架附带了一个不错的Timer控件.
计时器类
该链接对此有概述.它实际上并没有在表单上绘制计时器,但是您可以获取它以在表单上的标签文本中显示当前经过的时间.

创建计时器

1.在工具箱中找到Timer控件.
2.将其拖动到表单上.
3.在属性窗口中,选择事件"选项卡(闪电).
4.双击Tick事件.
5.在其创建的功能中插入代码,以显示标签的经过时间. (可能需要将经过的时间转换为秒和分钟,并从您所说的10分钟中减去).
6.在表单加载中启动计时器,例如
Hi there,
Not going to give you a one size fits all solution.

There''s a nice Timer control that comes with the .Net framework.
Timer Class
This link has an overview of it. It doesn''t actually draw a timer on the form but you can get it to show the current elapsed time in the text of a label on the form.

To create a timer

1. find the Timer control in the toolbox.
2. Drag it on your form.
3. in the properties window select the events tab (lightning bolt).
4. Double click on the Tick event.
5. Insert code in the function it creates to display elapse time to a label. (May need to convert elapsed time to seconds and minutes and subtract it from the 10mins you stated)
6. In the form load start the timer e.g
sedtimer.Enabled = true;
sedtimer.Start();



如果您要求...,我的示例将在c#中.



My examples would be in c# if you ask for any...


这篇关于如何创建向用户显示的倒数计时器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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