views:

76

answers:

2

Hi all,

This is hopefully a softball syntax question: I need to call a method with an empty Object array for evaluation and set initial state. In C# I would just do this:

func(new Object[]{});

In VB.NET I am forced to do this:

Dim ctrls() As Control = {}
func(ctrls)

Is there a way to shorthand the call in VB.NET and have everything happen in one line of code?

P.S. VB-bashing will earn bonus points. ;-)

+4  A: 

Eerily similar to the C# syntax:

func(New Object() { })
itowlson
Yeah, only two characters off.
AMissico
lol.Thanks. The one iteration i didn't try.
Paul Sasik
+2  A: 

Use this:

func(New Control() {})
Hans Passant