Converting c# eventhandler code to vb.net

杀马特。学长 韩版系。学妹 提交于 2019-11-26 14:58:47

问题


What would be equivalent code in vb.net for the code below

dacServices.Message += new EventHandler<DacMessageEventArgs>(dbServices_Message);

回答1:


AddHandler dacServices.Message, AddressOf dbServices_Message

Most of converters do not work because you don't write new EventHandler in vb.net.

But you can see an example here: http://msdn.microsoft.com/en-us/library/ms743596.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-2

and for regular code conversion I use this converter: http://www.developerfusion.com/tools/convert/csharp-to-vb/



来源:https://stackoverflow.com/questions/19354696/converting-c-sharp-eventhandler-code-to-vb-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!