fireman Posted November 21, 2009 Posted November 21, 2009 I'm working with a basic console application. I'm trying to use the Console.SetWindowPosition method to put the console window at the top left of the screen, but for some reason its not working (and no error either). (I also set the console to the largest size possible, as you can see in my code) Here's my code: using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.Red; Console.SetWindowSize(Console.LargestWindowWidth, Console.LargestWindowHeight); Console.SetWindowPosition(Console.WindowLeft, Console.WindowTop);...etc etc... I also tried Console.SetWindowPosition(0, 0); but with no cigar. Any help would be greatly appreciated. Quote
Leaders snarfblam Posted November 22, 2009 Leaders Posted November 22, 2009 SetWindowPosition, along with WindowLeft and WindowTop, specify the location of the "view window" within the console's buffer. In other words, this seems to deal with scrolling within the console, and not the actual window on the desktop. As far as I can see, the console class does not provide what you are looking for. This code project article appears to address this need, among many others. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.