Showing results for November 2009 - Visual Basic Blog

Nov 16, 2009
0
0

Spot the Bug! – The Key to using Anonymous Types (Jonathan Aneja)

VBTeam
VBTeam

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...

Nov 12, 2009
0
0

Spot the Bug! – Is it in VB or XAML? (Jonathan Aneja)

VBTeam
VBTeam

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/present...

Nov 7, 2009
0
0

Linking Zune media items with LinQ, Part 2 (Matt Gertz)

Anthony D. Green [MSFT]
Anthony D. Green [MSFT]

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...

Nov 6, 2009
0
0

Linking Zune media items with LinQ, Part 1 (Matt Gertz)

Anthony D. Green [MSFT]
Anthony D. Green [MSFT]

Way back in October 2007, I wrote up a few posts (here and here) on my experiments with the Windows Media Player object model.  The problem I was trying to solve was that, when I had a playlist set to “shuffle,” WMP would break up songs that should always play together (for example, Jackson Browne’s “The Load-Out”...

Nov 5, 2009
0
0

Spot the Bug! – Much ado about Nothing… Part 2! (Jonathan Aneja)

VBTeam
VBTeam

In yesterday’s post we saw that the use of the wrong comparison operator with Nothing in an If block can lead to surprising results.  Let’s look at a slightly different case today:         Dim x As Integer = Nothing         If x = Nothing Then &nbs...

Nov 3, 2009
0
0

Spot the Bug! – Much Ado about Nothing… (Jonathan Aneja)

VBTeam
VBTeam

Microsoft has this neat mailing list called “Spot the Bug” where developers can send interesting snippets of code that look correct but actually have subtle bugs in them.  The puzzles are a lot of fun and I’ve always thought it’d be a fun thing to try here on the team blog.  Over the past year or so I’ve been keeping a list of interesting...