Future blogs on Visual Basic can be found on the official .NET blog going forward.
Visual Basic Blog
A group blog from members of the VB team
Latest posts
New Learning Resources on the Visual Basic Developer Center (Beth Massi)
Today we revamped some of the Visual Basic Developer Center Learn pages with more content that allows you to pivot on more fine-grained topics and tasks related to Visual Basic programming. We’ve started with the Introductory Topics and Language Syntax pages. To get there, head to http://msdn.com/vbasic and then click the Learn tab. There you will see a set of general topic areas to explore. If you select Introductory Topics or Language Syntax you will be taken to a new set of pages that lets you browse on more sub-topics and tasks. Select a topic from the list on the left and the content will change on...
What didn't get into VB10: a wish-list for future versions of VB
Visual Studio 2010 is almost out the door. Now is a good time to look back at what we didn't get into the language in this release, but would have wanted to, and so will consider for future releases.Over the coming weeks, each day, I'll blog on blogs.msdn.com/lucian about the ideas on our wish-list, along with our evaluation of them. We have our own thoughts about what are the priorities for the VB language. You'll have your own thoughts - please tell us!The series starts here:The Wish-List Introduction...Req0: Don't add to (or change) the languageCore1: IteratorsCore2: Inline and multi-l...
The many cases of ByRef
One of the overlooked or simply misunderstood features of the VB language is calling a function which has a ByRef parameter. Most languages support only a single method of passing parameters by reference [1], that is the scenarios directly supported by the CLR. The CLR has a lot of restrictions on the type of values it supports for ByRef parameters and these restrictions get in the way of VB’s goal to be a flexible language that strives to get out of the way of the user. Hence the compiler goes to great lengths to be flexible and support multiple avenues of ByRef passing, much beyond what the CL...
Fun With Dynamic Objects (Doug Rothaus)
A while back, I remember being asked if there was a simple way to expose a source XML document as an object with properties. That is, if the root XML element had a child element <Name>Doug</Name>, then the object would have a Name property that was a string and returned “Doug”. The catch was that the XML document did not conform to a specific schema. Hence, you could not simply create an object with a Name property, because you did not know if the source document had a <Name> element. While there are ways to expose the XML data dynamically, you couldn’t quite do what was being ...
There’s No Such Thing As Too Much Euchre! (Matt Gertz)
“Oh, no!” I hear you cry, “not another blog about Euchre!”Well, I do like the game, to be sure. But, more importantly, the Euchre scenario enables me to try out any new technologies on a reasonably complex problem (using Visual Basic, of course). It’s my way of checking out our product to make sure that it works before we ship it out to you guys. For my app building this time around, I chose to focus my energies in two areas – WPF, and Windows Mobile. Porting my Euchre game to these platforms was challenging in several different ways, and I thought that ...
Hidden Gems in VB2010 – Serializing Objects that Raise Events (Jonathan Aneja)
By now you've likely heard about the major new features coming in VB 2010, but there's also a number of smaller additions in the language and IDE that might not be as readily noticeable. "Hidden Gems" will be a multi-part series where we'll explore some of these smaller enhancements. First up - serialization! Let’s say you have a simple entity class that you need to serialize and send over the wire. This class implements INotifyPropertyChanged which contains an event. When attempting to serialize an instance of this class, if the delegate which backs the event has its Target property ...
Spot the Bug! – The Key to using Anonymous Types (Jonathan Aneja)
This one’s going to be long, but for those of you who’ve felt the first 3 in this series were too easy I promise this one’s tougher J. Let’s say you want to list all the customers from a table in a ComboBox, and update the UI based on which one is selected. To do this we’ll need to bring back two fields from the database – the customer’s name and the customer’s ID. When a customer is selected we want the ComboBox’s SelectedValue property to equal the customer’s ID. Here’s some quick code that gets us up and running (using Nort...
Spot the Bug! – Is it in VB or XAML? (Jonathan Aneja)
What’s wrong with the following WPF code? Class Window1 Sub OK_Click(sender As Object, e As RoutedEventArgs) Handles OK.Click MsgBox("Button Clicked") End Sub End Class <Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid> <Button Name="OK" Click="OK_Click">OK</Bu...
Linking Zune media items with LinQ, Part 2 (Matt Gertz)
In this post, I’ll continue on with coding the new playlist shuffler. If you haven’t read part 1 yet, I highly recommend it so that this post will make more sense. JCode for the controls (continued)The Title TextBoxWhen the title changes, we’ll want to indicate that the playlist has changed, and we’ll want to cache the change and update the menus. This is pretty simple: Private Sub edtTitle_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edtTitle.TextChanged playlistTitle = edtTitle.Text...