欢迎光临散文网 会员登陆 & 注册

C#上位机开发串口通信编程

2023-03-01 10:23 作者:wd179852  | 我要投稿

p4作业:

按钮里的代码怎么改就行:

 private void button1_Click(object sender, EventArgs e)

    {

     

      int clickTimes; //按下du次数

              //获取按zhi下次数

      object tag = this.button1.Tag;

      if (tag == null)

      {

        clickTimes = 0;

      }

      else

      {

        clickTimes = Convert.ToInt32(tag);

      }

      //增加并记录按下次数

      this.button1.Tag = ++clickTimes;

      if ((clickTimes % 2) == 1)

      {

        //执行你的事dao情1

        string str = comboBox1.Text;

        time = Convert.ToUInt16(str.Substring(0, 2));

        progressBar1.Maximum = time;

        timer1.Start();

        button1.Text = "停止计时";

      }

      else

      {

        timer1.Stop();

      }

    }

C#上位机开发串口通信编程的评论 (共 条)

分享到微博请遵守国家法律