protected void CheckThread() { if (Parent != null && Control.CheckForIllegalCrossThreadCalls) if (Parent.InvokeRequired) throw new InvalidOperationException("Cross-thread calls are not allowed"); }