Question

I would like to write a .NET Console Application that shows certain values and statistics.

For this I need the Console to not scroll and write to certain places on the console window.

I have seen this behaviour in other applications as well (e.g. unix top/htop) and was wondering if there is a libary for .NET to do this?

Was it helpful?

Solution

You can use the Console.SetCursorPosition method to position the cursor over existing text so you overwrite it instead of "appending" to the end.

OTHER TIPS

You might look at the answers to this question for possibilities.

The built-in Console class also has CursorLeft, CursorTop, WindowWidth, and WindowHeight properties that you can use to figure out the size of the console window, and SetCursorPosition to position the cursor prior to writing. The documentation for the Console Class might give you a hint for any other functionality you need.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top