VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/console-setwindowposition-method-in-c-sharp/

⇱ Console.SetWindowPosition() Method in C# - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Console.SetWindowPosition() Method in C#

Last Updated : 11 Jul, 2025
Console.SetWindowPosition(Int32, Int32) Method in C# is used to set the position of the console window relative to the screen buffer.
Syntax: public static void SetWindowposition(int left, int top); Parameters: left: It is the column position of the upper left corner of the console window. top: It is the row position of the upper left corner of the console window.
Exceptions:
  • ArgumentOutOfRangeException: When left or top is less than 0 or left + WindowWidth > BufferWidth or top + Windowheight > BufferHeight.
  • SecurityException: If the user doesn't have the permission to perform this action.
Example: Output: 👁 Image
When Console.WindowPosition() method is not used: 👁 Image
Reference:
Comment
Article Tags:
Article Tags:

Explore