Groups | Blog | Home
all groups > dotnet drawing api > october 2006 >

dotnet drawing api : Text color using WriteLine


John Harcourt
10/19/2006 1:02:02 PM

In a console application, how can I specify the color of the text when I do
a System.WriteLine() method? This is assuming of course that the output is
the console.

Thanks for any help.
Lloyd Dupont
10/20/2006 12:00:00 AM
There are new API in .NET2
Llok in the System.Console class documentation.
What about Console.ForegroundColor ?


[quoted text, click to view]

Joergen Bech <jbech<NOSPAM> NO[at]SPAM
10/20/2006 12:00:00 AM

Module Module1
Sub Main()
Console.WriteLine("Test White on Black")
Console.BackgroundColor = ConsoleColor.Blue
Console.WriteLine("Test White on Blue")
Console.ForegroundColor = ConsoleColor.Yellow
Console.WriteLine("Test Yellow on Blue")
Console.ReadLine()
End Sub
End Module

Nah ... that is too easy. Real men use API (as is being done
when setting those two properties) :)

So much stuff in the framework. So much still left out.
Hard to keep up.

/JB



On Fri, 20 Oct 2006 15:38:06 +1000, "Lloyd Dupont" <net.galador@ld>
[quoted text, click to view]
AddThis Social Bookmark Button