Method or Extension Method to Handle InvokeRequired
问题 I can't quite come up with the solution to creating a generic method to handle the InvokeRequired for void methods (I'll deal with return values later). I was thinking something like: // Probably not the best name, any ideas? :) public static void CheckInvoke(this Control instance, ,Action<object, object> action) { if (instance.InvokeRequired) { instance.Invoke(new MethodInvoker(() => action)); } else { action() } } Then I could write something like: public partial class MyForm : Form {