Mega Code Archive

 
Categories / VB.Net Tutorial / Data Type
 

Converting an enumerated value to a string

Imports System Public Class EnumSample         Enum Colors         Red = 1         Blue = 2     End Enum     Public Shared Sub Main()         Dim myColors As Colors = Colors.Red         Console.WriteLine("The value of this instance is '{0}'",myColors.ToString())     End Sub End Class