void communication_ThresholdReached(object sender, MyEventArgs e) { // MessageBox.Show (e.BufferLength.ToString()); // textBox1.Text = e.BufferLength.ToString(); this.Invoke((MethodInvoker)delegate { textBox1.Text = e.BufferLength.ToString(); // runs on UI thread }); }