Invoke跨线程访问控件的几种写法(备忘)
Invoke跨线程访问控件的几种写法
this.Invoke((EventHandler)(delegate { builder.Remove(0, builder.Length); foreach (byte b in buf) { builder.Append(LonzClass.TypeConvert.byteToHexStr(b) + " "); } listBox1.Items.Add("收到串口" + comm.PortName + "数据:" + builder.ToString()); }));
this.Invoke(new Action(()=> { lstServer.Items.Add("Client:" + clientep.Address + "("+clientep.Port+")"); }));

浙公网安备 33010602011771号