如题...

解决方案 »

  1.   

          this.timer1.Enabled = false;  
      

  2.   

    请问一下当 this.timer1.Enabled   =   false; 
    timer里面原有的值会不会被清除? 
      

  3.   

    已经成false当然失效了,要的话再激活
      

  4.   

    把timer的时间间隔改大点就是暂停了
      

  5.   

    我在button1里面激活一个timer1,计算时间,再在button2里面激活一个timer2计算时间,现在我想单击button2的时候能暂停一下timer1,但timer1的值不被清除,当我再次单击button1的时候,timer1再开始在原有的基础上计时.
      

  6.   

    http://topic.csdn.net/u/20071102/11/6e76daba-9c45-4b03-adb1-e1d6c3bf5e44.html
      

  7.   

    通过线程或者条件语句的控制,让timer里面的程序暂时不要执行即可。timer本身没有暂停的功能。
      

  8.   

    新开个项目,放入timer1、button1、button2,这是一个简单的演示,满足你的要求,分拿来
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;namespace WindowsApplication9
    {
        public partial class Form1 : Form
        {
            int second;//second 是秒数
            public Form1()
            {
                InitializeComponent();
            }        private void Form1_Load(object sender, EventArgs e)
            {        }        private void timer1_Tick(object sender, EventArgs e)
            {
                second++;//开始计时
                this .Text =second .ToString();//在窗体标题栏显示时间,随便找个地方显示的,
            }        private void button1_Click(object sender, EventArgs e)
            {
                timer1.Interval = 1000;//每秒执行一次
                timer1.Enabled = true;//timer开始
            }        private void button2_Click(object sender, EventArgs e)
            {
                timer1.Enabled = false;//timer暂停
            }
        }
    }
      

  9.   

    timer.Enable=false;
    timer.Stop();
    未尝不可?
      

  10.   

    好像没有,不过通过一点小技巧是可以实现的
    定义一个全局的 Stopwatch stop = new Stopwatch(); 
                 long time=0;

    private   void   timer1_Tick(object   sender,   EventArgs   e) 

       if(time>0)
       {
         timer1.Interval-=time;
         time=0;
       }
       else
       {
        timer1.Interval=value;//value为你自己定义的值
        }
    ……… 
       stop.Reset();
       stop.Start();//在timer函数的结尾开始计时;

    private void button1_Click(object   sender,   EventArgs   e) 
    {
      time=stop.ElapsedMilliseconds;//获取时间差。用你的timer1.Interval值减去time就是下次timer控件触发的时间
    }
    相信这段代码能满足你的要求吧