求个简单的Timer控件的小例子,我还不会用这个控件.想学下,随便什么例子,[C#]

解决方案 »

  1.   

    传说每天在CSDN吐口痰即可获得10分可用分!
      

  2.   

    简单来说拖个timer控件,设置下Interval属性,设置它的timer1_Tick事件。
    需要用的时候设置timer1.Enabled = true;就ok了。
      

  3.   


     private void Form1_Load(object sender, EventArgs e)
            {
                this.timer1.Enabled = true;
                this.timer1.Interval = 1000;
                //可以在属性中设置
            }        private void timer1_Tick(object sender, EventArgs e)
            {
                this.label1.Text = System.DateTime.Now.ToLongTimeString();
            }你这口痰吐的真不小  是不是感冒了
      

  4.   

    显示当前时间的一个label时钟
    private void Time1_Tick(object sender, EventArgs e)
            {            StatusLabel.Text = DateTime.Now.ToString();
            }
      

  5.   

    显示当前时间的一个label时钟
    private void Time1_Tick(object sender, EventArgs e)
            {            StatusLabel.Text = DateTime.Now.ToString();
            }
      

  6.   


    那如果窗体上有个Button控件,可不可以做到这样:
    没隔1秒,让Button控件的位置向右移动100        private void timer1_Tick(object sender, EventArgs e)
            {
                //这个事件 如何写代码呢?
            }
            private void 调用方法()
            {
                timer1.Enabled = true;
            }
      

  7.   


    this.timer1.Enabled = true;//可用状态
    this.timer1.Interval = 1000;//循环时间 毫秒
    this.timer1.Start();//开始执行
    this.timer1.Stop();//结束计时//循环事件
    private void timer1_Tick(object sender, EventArgs e)
    {
       this.label1.Text = System.DateTime.Now.ToLongTimeString();
    }在看看委托,随时定义timer和事件,更方便使用
      

  8.   

    this.timer1.Enabled = true;
                this.timer1.Interval = 1000;
    this.timer1.start();
      

  9.   


    button.Location = new Point(button.Location.X + 100, button.Location.Y);
      

  10.   


    this.timer1.Enabled = true;//可用状态
    this.timer1.Interval = 1000;//循环时间 毫秒
    this.timer1.Start();//开始执行
    //this.timer1.Stop();//结束计时//循环事件
    private void timer1_Tick(object sender, EventArgs e)
    {
       this.button1.Location = new Point(button.Location.X + 100, button.Location.Y);
    }
      

  11.   

    用的时候time1.Start()就行
    不用了就timer1.Stop();
      

  12.   

    this.timer1.Enabled = true;//可用状态 
    this.timer1.Interval = 1000;//循环时间 毫秒 
    this.timer1.Start();//开始执行 
    //this.timer1.Stop();//结束计时 //循环事件 
    private void timer1_Tick(object sender, EventArgs e) 

      this.button1.Location = new Point(button.Location.X + 100, button.Location.Y); 
      

  13.   

    MSDN上输入Timer查找Timer控件就看到了
    有实例的
      

  14.   

    private void timer1_Tick(object sender, EventArgs e)
            {
                this.button1.Left = this.button1.Left + 100;
            }真能折腾
      

  15.   


    回复你6楼
            private void Form1_Load(object sender, EventArgs e)
            {
                timer1.Enabled = true;
                timer1.Interval = 1000;
            }        private void timer1_Tick(object sender, EventArgs e)
            {
                button1.Location = new Point(button1.Location.X+10, button1.Location.Y);
            }
      

  16.   

    界面上拖个控件,用下面代码试试效果看看吧 private void ttm1_Tick(object sender, System.EventArgs e)
    {
    this.Opacity=this.Opacity+0.02;
    if(this.Opacity>0.98)
    {
    this.Opacity=1;
    ttm1.Stop(); }
    }
      

  17.   

    timer控件用的不熟,只试过在一个label上根据timer值1000也就是一秒更新显示时间
      

  18.   


    D:\Backup\我的文档\My Pictures\4.jpg
      

  19.   

    this.timer1.Enabled = true;
    this.timer1.Interval = 1000;//一秒钟执行一次
    在timer事件里面写:
    LB_TextTimer.Text = System.DateTime.Now.ToString();