views:

34

answers:

2

Is there a way to get the instance's class name with VB.NET?

+3  A: 

Try the following

Dim name = Me.GetType().Name

Or for any instance

Dim name = theObject.GetType().Name
JaredPar
+1  A: 
Dim type As Type = yourObject.GetType()
Dim typeName As String = type.FullName

Full name will get you the fully qualified name of the Type, including the namespace of the Type.

See MSDN for more information on what is available with Type.

Kelsey