开发者

how do i translate newButton.Click += delegate { window.IsOpen = false; }; in vb.net

开发者 https://www.devze.com 2023-01-30 11:01 出处:网络
how do i translate newButton.Click += delegate { window.IsOpen = false; }; in 开发者_StackOverflowvb.netHow about

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

精彩评论

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