C# version here.
VB2008 introduced initialiser syntax, which allows you to initialise the property values of a newly created object in a With block that is basically attached to the constructor, e.g.
VB.NET Code:
Dim myObject As New SomeType With {.Property1 = value1, .Property2 = value2}
You might ask what's the use of this. Why is it any better than doing this:
VB.NET Code:
Dim myObject As New SomeType
With myObject
.Property1 = value1
.Property2 = value2
End With
Well, it's a bit more succinct than that for a start, but that's not where the real advantage lies. The property (or field) initialisation is actually part of the expression that returns a reference to the newly created object. As such you can use initialiser syntax in places where you couldn't use a With block or a more conventional pattern because it would require multiple lines of code. One example is when initialising member variables, e.g.
VB.NET Code:
Private myObject As New SomeType With {.Property1 = value1, .Property2 = value2}
Normally you'd have to set the properties in the form's Load event handler or something like that.
Another place where this is useful is when you want to create one object and then pass it to the constructor, or some method, of a second, but you want to set one or more properties of the first object. Previously you'd have had to do something like this:
VB.NET Code:
Dim obj1 As New SomeType
obj1.SomeProperty = someValue
Dim obj2 As New SomeOtherType(obj1)
Now you can do this:
VB.NET Code:
Dim obj2 As New SomeOtherType(New SomeType With {.SomeProperty = someValue})
This is not a revolutionary change, but it does let you keep your code more concise in certain circumstances.
One thing I would caution against is using initialiser syntax in situations where it actually makes your code harder to read, which may happen if you nest too deeply or have lines that are too long. To help avoid this in certain circumstances, I strongly recommend using line continuation to make your code more readable, e.g.
VB.NET Code:
Dim myObject As New SomeType With {.Property1 = value1, _
.Property2 = value2}