Anonymous method in Invoke call
问题 Having a bit of trouble with the syntax where we want to call a delegate anonymously within a Control.Invoke. We have tried a number of different approaches, all to no avail. For example: myControl.Invoke(delegate() { MyMethod(this, new MyEventArgs(someParameter)); }); where someParameter is local to this method The above will result in a compiler error: Cannot convert anonymous method to type \'System.Delegate\' because it is not a delegate type 回答1: Because Invoke / BeginInvoke accepts