timer控件周期为1分钟,如何能让timer控件在每整分钟的时候触发!也就是第一次触发的时间的整分钟,如:12:12:00;然后下一次就是12:13:00;
谢谢!

解决方案 »

  1.   

    设置时间间隔为100毫秒,发现到整分钟后,调整为间隔1分钟
    private void timer1_Tick(object sender, EventArgs e)
    {
      if(timer1.Interval==100 && DateTime.Now.Second==0)
      {
        timer1.Interval = 60000;//重新设置为1分钟间隔
      }  if(timer1.Interval == 60000)
      {
        //你要做的事情
      }
    }
      

  2.   

      private Timer _MyTimer = new Timer();        private void button2_Click(object sender, EventArgs e)
            {
                _MyTimer.Interval = 60*1000;         
                _MyTimer.Tick += new EventHandler(_MyTimer_Tick);
                while (true)
                {              
                    if (DateTime.Now.Second == 0)
                    {                    
                        _MyTimer.Enabled = true;
                        break;
                    }
                    Application.DoEvents();
                }
              
            }        void _MyTimer_Tick(object sender, EventArgs e)
            {
                this.Text = DateTime.Now.ToString("hh:mm:ss");
            }
    是不是这个意思啊