views:

225

answers:

2

Hello,

Simple question from .NET beginner. How to work with colors in console application? VS do not let me declarate System.Drawing.Color namespace. I need to assign color for one method in console application.

Regards, Tomas

+6  A: 

All you need to do is add a reference to System.Drawing.dll. This isn't included by default in a console app, but you can add it without any issues.

Jon Skeet
+2  A: 

This is actually very simple, for example:

Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Yellow");
Kristof Verbiest