private void SetAppStatusText(string text) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.appStatusLabel.InvokeRequired) { SetAppStatusCallback d = new SetAppStatusCallback(SetAppStatusText); this.Invoke(d, new object[] { text }); } else { this.appStatusLabel.Text = text; } }