如何使用C#.net窗口应用程序将计时器设置为30分钟或1小时 [英] How to set timer for 30 min or 1 hour using c#.net window application

查看:245
本文介绍了如何使用C#.net窗口应用程序将计时器设置为30分钟或1小时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用vs2008,c#.net窗口应用程序.
我想将计时器设置为30分钟或1小时.

计时器格式:-00:00:01(h:mm:ss)

打开表单时,默认情况下,我的计时器设置为这种类型的格式(00:00:01).
如何在c#.net中设置这种类型的格式.
我尝试过格式化,但是没有解决方法.

帮助将不胜感激....
mukesh

Hi All,

I am using vs2008, c#.net window applicaion.
I want to set timer for 30 min or 1 hr.

Timer Format:- 00:00:01 (h:mm:ss)

My timer is set by default this type of format (00:00:01),when form is open.
how to set this type of format in c#.net.
I have tried format but did not get solution.

help will be appriecated....
mukesh

推荐答案

尝试使用Microsoft的此链接:
====================


http://msdn.microsoft.com/zh-我们/library/system.timers.timer%28v=vs.71%29.aspx [ C#.net中的呼叫计时器 [如何在计时器继续计时显示消息框? [
Try this link from Microsoft:
=====================


http://msdn.microsoft.com/en-us/library/system.timers.timer%28v=vs.71%29.aspx[^]


and this:
=======

Call Timer in C#.net[^]

how to continue timer when a message box is shown?[^]


System.Windows.Forms计时器(我假设这是您使用的计时器)有一个interval属性,它是一个int类型,以毫秒为单位,因此要将计时器间隔设置为30分钟,只需将其设置为30000,

The System.Windows.Forms Timer (I assume this is the one you are using) has an interval property, which is an int type and is measured in milliseconds, so to set the timer interval to 30 minutes you just set it to 30000 ,

System.Windows.Forms.Timer timer;
            timer.Interval = 30000;



您完全不必担心时间的格式.

希望对您有帮助



You do not have to worry about the format of the time at all.

Hope this helps


这篇关于如何使用C#.net窗口应用程序将计时器设置为30分钟或1小时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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