Excuse me for the question, here I put the cmd in fixed size, that the user cannot resize it with the mouse,
I had the same case in C++.
HWND consoleWindow = GetConsoleWindow(); SetWindowLong(consoleWindow, GWL_STYLE, GetWindowLong(consoleWindow, GWL_STYLE) & ~WS_MAXIMIZEBOX & ~WS_SIZEBOX); But I don't have any idea for C#, in the meantime I made the principle of launching a threading
int x = Console.WindowWidth; int y = Console.WindowHeight; while (true) { if (Console.WindowWidth != x && Console.WindowHeight != y) { Console.SetWindowSize(x, y); } } But if you know another method, impossible to find in the microsoft doc, or other. Unless I looked wrong.
Thanks for your help
&&should be an||, otherwise they can change the size in one direction and then the other.