private void SetTextPanel(Color c) { // 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. try { if (this.panel1.InvokeRequired) { SetTextCallbackPanel d = new SetTextCallbackPanel(SetTextPanel); this.Invoke(d, new object[] { c }); } else { panel1.BackColor = c; } } catch { } }