I need to convert the following code from C# to VB.NET.
lnkSynEvent.Click +=
new EventHandler((s,e)=>lnkSynEvent_Click(s, e, your_parameter));
Here lnkSynEvent is the id of button. Any Help is appreciated.
I need to convert the following code from C# to VB.NET.
lnkSynEvent.Click +=
new EventHandler((s,e)=>lnkSynEvent_Click(s, e, your_parameter));
Here lnkSynEvent is the id of button. Any Help is appreciated.
It can be used like this:
AddHandler lnkSynEvent.Click , Sub(s, ea) lnkSynEvent_Click(s, ea, your_parameter)
Or this:
AddHandler lnkSynEvent.Click , Sub(s, ea)
lnkSynEvent_Click(s, ea, your_parameter)
End Sub
Note
Pay attention, you should have a lnkSynEvent_Click accepting 3 parameters of consistent types which you are trying to pass to it.
Usually you can trust the out put of online code converters, but you should have enough knowledge and know syntax yourself enough to be able to change some part of converted codes.
For more description and example take a look at Lambda Expressions (Visual Basic).
You get online code converter which can help you to convert C# to VB.
lnkSynEvent.Click += New EventHandler(Function(s, e) lnkSynEvent_Click(s, e, your_parameter))