这段代码我引用CheckUpdate检测组件,主程序启动时可以检测更新,我加了个Timer控件定时检测更新,但是没反应,不会定时检测,大家帮忙指导下吧,头都大了!以下是代码:namespace test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }        private void Form1_Load(object sender, EventArgs e)
        {
            
        }        private void CheckUpdate1(object sender, EventArgs e)
        {        }         private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Tick += new System.EventHandler(CheckUpdate1);
        }    }
}

解决方案 »

  1.   

    看不懂学习 不过你要多长时间检测一次更新 不会是3秒吧 timer好像不能设的时间特别长
      

  2.   

    你的意思是要每隔3秒触发CheckUpdate1事件就能自动检测更新了 是吧,
    试试在构造方法中定义timer1.Tick += new System.EventHandler(CheckUpdate1); 
    或者在timer_tick中直接调用CheckUpdate1()不行吗?
      

  3.   

    lz,你设置了Timer,你的Timer在什么地方开始计算时间呢?好像没有吧
    看了一下你的点吗,我给你写一下吧namespace test 

        public partial class Form1 : Form 
        { 
            public Form1() 
            { 
                InitializeComponent(); 
                this.timer1.Start();
            }         private void Form1_Load(object sender, EventArgs e) 
            { 
                
            }         private void CheckUpdate1(object sender, EventArgs e) 
            {         }         private void timer1_Tick(object sender, EventArgs e) 
            { 
                timer1.Tick += new System.EventHandler(CheckUpdate1); 
            }     } 
    } ok了是不是
      

  4.   


    不行,我添加的组件后名称是checkUpdate1,我这里用了CheckUpdate1,第一个字母大写了,但我改成checkUpdate1后,提示Form中已经包含了checkUpdate定义,不知道是不是这个原因?