how do i translate newButton.Click += delegate { window.IsOpen = false; }; in vb.net
how do i translate
newButton.Click += delegate { window.IsOpen = false; };
in 开发者_StackOverflowvb.net
How about
newButton.Click += Function() Do
window.IsOpen = False
End Function
This is very helpfull
Convert C# to VB.NET
Another one (with VS 2010)
AddHandler newButton.Click,
Sub(s As Object, e As EventArgs)
window.IsOpen = false
End Sub
following should also work:
AddHandler newButton.Click,
Sub()
window.IsOpen = false
End Sub
EDIT: For VS 2008, multi-statement anonymous methods are not possible, so it would be something like
AddHandler newButton.Click, _
Function(s As Object, e As EventArgs) window.IsOpen = false
精彩评论