主题 : c#下如何写定时程序 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 33843
精华: 0
发帖: 21
金钱: 110 两
威望: 22 点
综合积分: 42 分
注册时间: 2010-12-07
最后登录: 2013-12-03
楼主  发表于: 2011-02-18 14:39

 c#下如何写定时程序

private void InitializeComponent()
        {
            this.timer1 = new System.Windows.Forms.Timer();
            this.SuspendLayout();
            //
            // timer1
            //
            this.timer1.Enabled = true;
            this.timer1.Interval = 1000;
            this.timer1.Tick += new System.EventHandler(this.timer1_Tick_1);
            //
            // Game
            //
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
            this.ClientSize = new System.Drawing.Size(638, 455);
            this.Name = "Game";
            this.Load += new System.EventHandler(this.Game_Load);
            this.ResumeLayout(false);

        }
        private void Game_Load(object sender, EventArgs e)
        {
          
        }

        private void timer1_Tick_1(object sender, EventArgs e)
        {
            // 显示窗体
            this.Show();
       不执行这句话
        }

我是这样写的,可就是不进来,是什么地方错了吗?请指点一下
描述:源程序,请指点
附件: hitsuslinks.rar (545 K) 下载次数:11
级别: 新手上路
UID: 41753
精华: 0
发帖: 3
金钱: 15 两
威望: 3 点
综合积分: 6 分
注册时间: 2011-04-01
最后登录: 2011-12-08
1楼  发表于: 2011-04-01 02:41
改成这样试试
this.timer1.Interval = 1000;
this.timer1.Enabled = true;