private void UpdateStatus(string text) { if (this.textBox1.InvokeRequired) { AlterTextCallback d = new AlterTextCallback(UpdateStatus); this.Invoke(d, new object[] { text }); } else { try { textBox1.Text = text; } catch (ObjectDisposedException) { // Deliberately do nothing -- the UI is gone anyway } } }