编写 Dispatcher.Invoke VB.NET

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24372645/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 17:45:45  来源:igfitidea点击:

Writing the Dispatcher.Invoke VB.NET

vb.netdispatcher

提问by Zingo

Im just trying to figure out the syntax for a Dispatcher.Invoke in vb.net. I have it working in a C# application, but now i need the VB form. Here is the code i have for my C# application

我只是想弄清楚 vb.net 中 Dispatcher.Invoke 的语法。我让它在 C# 应用程序中工作,但现在我需要 VB 表单。这是我的 C# 应用程序的代码

 this.Dispatcher.Invoke((Action)(() =>
        {
            SOME CODE
        }));

All online sources seem to be C#, so any help would be appreciated. Thanks.

所有在线资源似乎都是 C#,因此将不胜感激。谢谢。

回答by David Sdot

Dispatcher.Invoke(Sub()

   ' CODE 

  End Sub)