Cannot convert anonymous method to type 'System.Delegate' because it is not a delegate type

 

When I tried to build the following code, I got the error.

    this.Invoke(delegate()
    {
        Application.DoEvents();
    });

 

I can overcome it by converting the anonymous method to a delegate:

    this.Invoke(new Action(delegate() {
        Application.DoEvents();
    }));


More to read:
They are Anonymous Methods, not Anonymous Delegates.
http://staceyw.spaces.live.com/blog/cns!F4A38E96E598161E!1042.entry 

0
0
(请您对文章做出评价)
« 上一篇:Windows XP Mode in Windows 7
» 下一篇:Windows 7
posted @ 2009-11-24 17:47 Warren Tang 阅读(18) 评论(0)  编辑 收藏 网摘 所属分类: dotNET