日期:2014-05-19  浏览次数:21112 次

MethodInvoker的小问题,在线等
MethodInvoker   mi   =   new   MethodInvoker(ShowStyleform);
IAsyncResult   isr   =   mi.BeginInvoke(null,   null);

ShowStyleform这个方法有个参数,我怎么传递?构造函数好像只可以传递方法名的?

如果不行如何变通?

------解决方案--------------------
MSDN:MethodInvoker 提供一个简单委托,该委托可执行托管代码中声明为 void 且不接受任何参数的任何方法。也就是说,本来就不可以传参数。另外定义一个delegate变量吧。