Esempio n. 1
0
 private void mtsics_OnDataStable(object sender, DataStableEventArgs args)
 {
     textBox1.BeginInvoke(new Action(() =>
     {
         textBox1.Text += args.OrgData;
     }));
 }
Esempio n. 2
0
        //串口数据接收
        private void mtsics_OnDataStable(object sender, DataStableEventArgs args)
        {
            try
                {
                    lxLedControl1.BeginInvoke(new Action(() =>
                    {
                        //"S S 111111g/r/n"=""

                        //     12.5 g

                        lxLedControl1.Text = args.OrgData.Substring(0, 1) + args.OrgData.Substring(2, 7);
                        label_danwei.Text = args.OrgData.Substring(9, 3).Trim();

                    }));

                }
                catch
                {
                    MessageBox.Show("重量异常");
                }
        }