Saturday, May 9, 2009

About visual C#.NET Console Program. (very simple if you know)?

hi all, I'm working on a visual C#.net console program and I need to change the color of my background (and text) of my program (the console if usually black and white) using "coding" inside my program. How?





and I know inside the msdn website, there is the exact information I need but I can't find them, care to show me the link?





finally, any suggestion how to make my console program more better???





Thanks...

About visual C#.NET Console Program. (very simple if you know)?
You can simply set the properties of the Console Class like so





Console.ForegroundColor = ConsoleColor.Red; //changes text color


or


Console.BackgroundColor = ConsoleColor.Blue;








If you run this then only the text on the screen will have the new colors you set. You can fix this by when you start your program set the colors that you want and then call





Console.Clear();





Doing this makes the entire window the colors that you want.


No comments:

Post a Comment