I would like to fill/update the entire bottom line of the console. Example:
static void Main(string[] args)
{
Console.BufferWidth = Console.WindowWidth;
Console.BufferHeight = Console.WindowHeight;
Console.CursorTop = Console.WindowHeight - 1;
string s = "";
for(int i = 0; i < Console.BufferWidth; i++)
s += (i%10).ToString();
Console.Write(s);
Console.CursorTop = 0;
Console.ReadKey();
}
The issue is that when the text is printed, it moves to a new line. Similar questions stated to move the cursor to 0,0, however that only works when the buffer size is larger than the window size, and I would like the buffer width and the window width to be equal (to remove scroll bars). Any ideas? The closest I could get is printing to a higher line and moving it to the last line, however that will not be acceptable in the full project.
Edit: The last sentence of the question was specifically talking about movebufferarea. The reason why that won't work can be seen by this example:
static void Main(string[] args)
{
Console.BufferWidth = Console.WindowWidth;
Console.BufferHeight = Console.WindowHeight;
while (!Console.KeyAvailable)
{
Console.CursorTop = Console.WindowHeight - 2;
string s = "";
for (int i = 0; i < Console.BufferWidth; i++)
s += (i % 10).ToString();
Console.Write(s);
Console.MoveBufferArea(0, Console.WindowHeight - 2, Console.WindowWidth, 1, 0, Console.WindowHeight - 1);
Thread.Sleep(10);
}
}
The sentence will flicker every so often because it is printed first and then moved.
