public void setRecieve(string appendText) { if (InvokeRequired) { this.Invoke(new Action <string>(setRecieve), new object[] { appendText }); return; } ReceiveBox.AppendText(appendText); ReceiveBox.AppendText(Environment.NewLine); WriteBox.Text = ""; }
private void WriteData(string text) { if (string.IsNullOrEmpty(text)) { text = serial.ReadExisting(); } if (para.Inlines.Count >= 300) { para.Inlines.Clear(); } para.Inlines.Add(text); mcFlowDoc.Blocks.Add(para); ReceiveBox.Document = mcFlowDoc; ReceiveBox.ScrollToEnd(); }