コード例 #1
0
ファイル: Form1.cs プロジェクト: fyyc1204/MTSICS
 private void mtsics_OnDataStable(object sender, DataStableEventArgs args)
 {
     textBox1.BeginInvoke(new Action(() =>
     {
         textBox1.Text += args.OrgData;
     }));
 }
コード例 #2
0
ファイル: MainFrm.cs プロジェクト: fyyc1204/MTSICS
        //串口数据接收
        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("重量异常");
                }
        }