ListBox1.BeginInvoke(new MethodInvoker(delegate
            {
                ListBox1.Items.Add("test");
            }));如上是C#的代码,
怎么改写成VB的代码?
100 分送上。。

解决方案 »

  1.   


    ListBox1.BeginInvoke(New MethodInvoker(Function() Do
    ListBox1.Items.Add("test")
    End Function))
      

  2.   

    ListBox1.BeginInvoke(New MethodInvoker(Function() ListBox1.Items.Add("test")))
    vs2010中通过编译测试。
      

  3.   


    谢谢,这里的 delegate 为什么要转换成Function()?我试了试,发现:
    ListBox1.BeginInvoke(New MethodInvoker(delegate () ListBox1.Items.Add("test")))
    也可以编译通过,哪个是正确的?
      

  4.   

    ListBox1.BeginInvoke(New MethodInvoker(delegate () ListBox1.Items.Add("test")))2008,2010都无法编译通过。不知道你用的什么编译器。
      

  5.   


    VS2005:ListBox1.BeginInvoke(New MethodInvoker(delegate()
                ListBox1.Items.Add("test")
    ))
    可以通过编译。
      

  6.   

     这里可以转换 http://www.developerfusion.com/tools/convert/csharp-to-vb/