Login or Sign Up to become a member!

EXPERTS, INFORMATION, IDEAS & KNOWLEDGE

Social bookmarker Add this

Your profile

Search

January 2009
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

XML Feeds

Authors

Tags: happy

The Desktop Developers Journal

New features in Visual Basic 10

by chrissie1


Permalink 30 Oct 2008 05:55 , Categories: Microsoft Technologies Tags: happy, vb.net

YEEEEEEEEEEEEHA :D the spelling checker didn’t like that one), here are some of the new features in VB 10.
And yes, I did sound happy there, because some of these features are really not optional but much needed. Like the multi-line lambda and the sub lambda.

You can find the whole video on Channel9

Multi-line lambdas will look like this

  1. myfunction.lambdathing(Function(e) e.dosomething
  2.                                    e.dosomethingelse
  3.                        End Function)

Or like this

  1. myfunction.lambdathing(Sub() dosomething
  2.                              dosomethingelse
  3.                        End Sub)

Now this will also be possible. And I’m very happy about that.

  1. myfunction.lambdathing(Sub() dosomething)

They will also support auto properties and collection initializers, neither of which I really needed.

I’m so happy, I think I will stick with VB for a while. Although all the catching up to C# thing is annoying. I just hope it doesn’t become a VS 2011 or later version. Let’s make it a VS 2010 that came out in 2009 version shall we?

And here is some other stuff that should be possible.

  1. Private Sub SomeMethod()
  2.      Dim _counter as Integer = 1
  3.      AddHandler Button1.Click, Sub()
  4.                                       _counter += 1
  5.                                       TextBox1.text = _counter
  6.                                   End Sub
  1. Private Sub SomeMethodRunningInAnotherThread()
  2.      Me.Dispatcher.Invoke(Normal, Sub()
  3.                                       ‘Do some other stuff
  4.                                       SomeTextBox.Text = "Test"
  5.                                   End Sub)
  6.  End Sub

Info found after some random surfing on StackOverflow

4 comments »Send a trackback » 339 views