Select case on an object's type in .NET
This is an alternative to converting the type into a string and checking against that. This version survives refactors of class names much better.
Select Case msg.GetType()
Case GetType(ClassA)
Case GetType(ClassB)
Case Else
End Select