Set console: title, window size, buffer height and width, cursor position : Console « Development Class « C# / C Sharp






Set console: title, window size, buffer height and width, cursor position

Set console: title, window size, buffer height and width, cursor position
  

using System;

public class Test{
   static void Main(string[] args){


      // Change the Console appearance and redisplay.
      Console.Title = "Resized Console";
      Console.ResetColor();
      Console.Clear();
      Console.SetWindowSize(100, 50);
      Console.BufferHeight = 500;
      Console.BufferWidth = 100;
      Console.CursorLeft = 20;
      Console.CursorSize = 50;
      Console.CursorTop = 20;
      Console.CursorVisible = false;
      Console.WriteLine("Main method complete. Press Enter.");
      Console.ReadLine();

  }
}


           
         
    
  








Related examples in the same category

1.Echo some stats
2.Read a line of string and check its length
3.WriteLine and Write
4.Printing one line of text with multiple statements.
5.Printing multiple lines with a single statement.
6.Printing multiple lines of text with string formatting.
7.Displaying the sum of two numbers input from the keyboard.
8.Change console foreground color and background colorChange console foreground color and background color
9.Clear consoleClear console
10.CursorVisible ResetColor SetWindowSize BufferHeight BufferWidth CursorLeft CursorSize CursorTop
11.Use Red and Green from ConsoleColor
12.Beep
13.Beep(200, 300)
14.Use format specifiers with Console.WriteLine
15.Console Output Util
16.If the console moves, Pause.