窗口更新假死解决方法

 this.Invoke((EventHandler)(delegate
            {
                if (ckbReceiveHEX.Checked)
                {
                    foreach (byte b in buf)
                    {
                        builder.Append(b.ToString("X2") + " ");
                    }
                }
                else
                {
                    builder.Append(Encoding.ASCII.GetString(buf));
                }
                this.tbxReceive.AppendText(builder.ToString());
                labRxCount.Text = "Rx:" + received_count.ToString();
            })); 

你可能感兴趣的:(窗口更新假死解决方法)