private void UpdateDisplay() { if (status != serialstatus.Downloading) { textBox1.AppendText(line); } label1.Text = Convert.ToString(cross); if (isConnected) { lStatus.Text = status.ToString() + " " + receivedbytes + " " + serialPort1.BytesToRead; } else { lStatus.Text = status.ToString() + " " + receivedbytes + " 0"; } this.Refresh(); }
void updateDisplay() { if (start.Second != DateTime.Now.Second) { this.BeginInvoke((System.Windows.Forms.MethodInvoker) delegate() { try { TXT_status.Text = status.ToString() + " " + receivedbytes + " " + comPort.BytesToRead; } catch { } }); start = DateTime.Now; } }
void updateDisplay() { if (this.IsDisposed) { return; } if (start.Second != DateTime.Now.Second) { this.BeginInvoke((System.Windows.Forms.MethodInvoker) delegate() { try { TXT_status.Text = status.ToString() + " " + receivedbytes; } catch { } }); start = DateTime.Now; } }