ConsoleColor Enumeration
Public Module Example
Public Sub Main()
Dim colorNames() As String = ConsoleColor.GetNames(GetType(ConsoleColor))
For Each colorName As String In colorNames
Dim color As ConsoleColor = CType(System.Enum.Parse(GetType(ConsoleColor), _
colorName), ConsoleColor)
If color = ConsoleColor.Black Then Continue For
Console.Write("{0,11}: ", colorName)
Console.BackgroundColor = ConsoleColor.Black
Console.ForegroundColor = color
Console.WriteLine("This is foreground color {0}.", colorName)
Console.ResetColor()
Next
End Sub
End Module
Related examples in the same category