标题:timer 在 case 里面启动不了?
取消只看楼主
aa7728737
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2014-7-22
结帖率:0
已结贴  问题点数:5 回复次数:0 
timer 在 case 里面启动不了?
private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Enabled = false;
byte[] buffer11 = new byte[9];
            buffer11[0] = 0x5A;
            buffer11[1] = 0xA5;
            buffer11[2] = 0x05;
            buffer11[3] = 0x82;
            buffer11[4] = 0x00;
            buffer11[5] = 0x65;
            buffer11[6] = (byte)(value1);// 0x00;//(byte)(sd);//0x00
            buffer11[7] = (byte)(ab);//(byte)(sd1);//0x0B
             timer1.Enabled = true;
}
  private void serialPort4_DataReceived(object sender, e)
        {timer1.Enabled = false;
switch(a)
{
case 1:
a=1;
timer1.Enabled = true;
break;
case 2;
a=2;
timer1.Enabled = true;
break;
case 3;
a=3;
timer1.Enabled = true;
break;



}

}
搜索更多相关主题的帖子: private false 
2014-07-22 11:42



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-434289-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.146350 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved