How to convert this line from C# to VB.net (Windows Phone 7)

你说的曾经没有我的故事 提交于 2019-12-31 05:13:48

问题


Hi I am studying some codes from the web that I need for a future project, but I am having trouble changing this code from C# to VB.net. Can someone help pleasE?

this.btnAdd.Click += btnAdd_Click;

回答1:


Adding event handlers is done differently in VB.NET:

AddHandler btnAdd.Click, AddressOf btnAdd_Click

Source




回答2:


AddHandler(btnAdd.Click, AddressOf btnAdd_Click)



回答3:


Most often, for simplier conversions like that, you can use the web based tool at http://www.developerfusion.com/tools/convert/csharp-to-vb/
Though, it should be seen as a advise or guideline.



来源:https://stackoverflow.com/questions/9728926/how-to-convert-this-line-from-c-sharp-to-vb-net-windows-phone-7

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