tags:

views:

777

answers:

3

What is the best way to write data to the text console at arbitrary locations on the screen and with custom fore/background colors?

+14  A: 

Console.SetCursorPosition, Console.BackgroundColor, Console.ForegroundColor, and Console.ResetColor.

Note these were added to the .NET Framework in version 2.0. Prior to that you would have needed PInvoke.

C. Dragon 76
+2  A: 

According to the Mono Library List there are at least two libraries that could be useful for you:

  • Curses# uses PDCurses on Windows and NCurses on Linux. It's almost crossplatform on an binary level.

  • MonoCurses is an MIT-X11 licensed binding of curses, and it includes the minimalistic gui.cs GUI toolkit for creating console-based applications.

Manga Lee
+3  A: 

This posting shows how to use Console class methods to create a progress bar on the console - it might be a good example to refer to....

Werg38