开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜