public static class ControlThreadingHelper { public static void InvokeControlAction(t control, Action action) where t : Control { if (control.InvokeRequired) control.Invoke(new Action(InvokeControlAction), new object[] { control, action }); else action(); } } public static class ControlThreadingExtensions { public static void Invoke(this t control, Action action) where t : Control { ControlThreadingHelper.InvokeControlAction(control, action); } }