473,378 Members | 1,617 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Why is my Console Application limiting itself to half the screen?

I have a Console Application, and when I do a "Start Without Debugging" to
test it, everything works, but it will not allow me to make the window wider
than half my screen. Even if I maximize it, it takes the full height, but
only half the width. This is very annoying, because sometimes lines are
longer than half the screen. Why is this, and is there any way to allow me
to make it take up the whole screen? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Oct 28 '08 #1
9 2975
Change the window properties to 132 columns. The width is probably maxed
out at 80 columns.

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:e1**************@TK2MSFTNGP04.phx.gbl...
>I have a Console Application, and when I do a "Start Without Debugging" to
test it, everything works, but it will not allow me to make the window
wider than half my screen. Even if I maximize it, it takes the full height,
but only half the width. This is very annoying, because sometimes lines are
longer than half the screen. Why is this, and is there any way to allow me
to make it take up the whole screen? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Oct 28 '08 #2
Where would I go to change this?
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Family Tree Mike" <Fa************@ThisOldHouse.comwrote in message
news:On**************@TK2MSFTNGP04.phx.gbl...
Change the window properties to 132 columns. The width is probably maxed
out at 80 columns.

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:e1**************@TK2MSFTNGP04.phx.gbl...
>>I have a Console Application, and when I do a "Start Without Debugging" to
test it, everything works, but it will not allow me to make the window
wider than half my screen. Even if I maximize it, it takes the full
height, but only half the width. This is very annoying, because sometimes
lines are longer than half the screen. Why is this, and is there any way
to allow me to make it take up the whole screen? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Oct 28 '08 #3
Right click on the console window's title bar and select properties. It
should be on the layout tab, shown as window size.

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:uV**************@TK2MSFTNGP04.phx.gbl...
Where would I go to change this?
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Family Tree Mike" <Fa************@ThisOldHouse.comwrote in message
news:On**************@TK2MSFTNGP04.phx.gbl...
>Change the window properties to 132 columns. The width is probably maxed
out at 80 columns.

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:e1**************@TK2MSFTNGP04.phx.gbl...
>>>I have a Console Application, and when I do a "Start Without Debugging"
to test it, everything works, but it will not allow me to make the window
wider than half my screen. Even if I maximize it, it takes the full
height, but only half the width. This is very annoying, because sometimes
lines are longer than half the screen. Why is this, and is there any way
to allow me to make it take up the whole screen? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Oct 28 '08 #4
That feature is no longer availabe in Vista.

"ĺĽ*克鹏" wrote:
alt + enter to solve the problem.
Oct 29 '08 #5
In addition to what Mike suggested, you can set the window Width and Height
of your Console at start up:

Console.WindowWidth = Console.LargestWindowWidth
Console.WindowHeight = Console.LargestWindowHeight

This will ensure that your Console takes up the whole working area and is
similar to what PowerShell does.

--
Stanimir Stoyanov
http://stoyanoff.info

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:e1**************@TK2MSFTNGP04.phx.gbl...
>I have a Console Application, and when I do a "Start Without Debugging" to
test it, everything works, but it will not allow me to make the window
wider than half my screen. Even if I maximize it, it takes the full height,
but only half the width. This is very annoying, because sometimes lines are
longer than half the screen. Why is this, and is there any way to allow me
to make it take up the whole screen? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Oct 29 '08 #6
That trick ROCKS!

I altered slightly, to get 90%

Console.WindowWidth = (Console.LargestWindowWidth * 9 / 10);

Console.WindowHeight = (Console.LargestWindowHeight * 9 / 10);

Thanks!!

"Stanimir Stoyanov" <st******@REMOVETHIS.live.comwrote in message
news:2E**********************************@microsof t.com...
In addition to what Mike suggested, you can set the window Width and
Height of your Console at start up:

Console.WindowWidth = Console.LargestWindowWidth
Console.WindowHeight = Console.LargestWindowHeight

This will ensure that your Console takes up the whole working area and is
similar to what PowerShell does.

--
Stanimir Stoyanov
http://stoyanoff.info

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:e1**************@TK2MSFTNGP04.phx.gbl...
>>I have a Console Application, and when I do a "Start Without Debugging" to
test it, everything works, but it will not allow me to make the window
wider than half my screen. Even if I maximize it, it takes the full
height, but only half the width. This is very annoying, because sometimes
lines are longer than half the screen. Why is this, and is there any way
to allow me to make it take up the whole screen? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Oct 29 '08 #7


"sloan" <sl***@ipass.netwrote in message
news:#X**************@TK2MSFTNGP02.phx.gbl...
That trick ROCKS!

I altered slightly, to get 90%

Console.WindowWidth = (Console.LargestWindowWidth * 9 / 10);

Console.WindowHeight = (Console.LargestWindowHeight * 9 / 10);
Or you could have used:

Console.WindowWidth = Console.LargestWindowWidth * 0.9
Console.WindowHeight = Console.LargestWindowHeight * 0.9

:D It's math. Multiple ways to do the same thing :)
hth,
Mythran
Oct 29 '08 #8

You should have tested your code dude:

Error 1 Cannot implicitly convert type 'double' to 'int'. An explicit
conversion exists (are you missing a cast?)

That's where I came up with the * 9 / 10 ...


"Mythran" <My*****@community.nospamwrote in message
news:7F**********************************@microsof t.com...
>

"sloan" <sl***@ipass.netwrote in message
news:#X**************@TK2MSFTNGP02.phx.gbl...
>That trick ROCKS!

I altered slightly, to get 90%

Console.WindowWidth = (Console.LargestWindowWidth * 9 / 10);

Console.WindowHeight = (Console.LargestWindowHeight * 9 / 10);

Or you could have used:

Console.WindowWidth = Console.LargestWindowWidth * 0.9
Console.WindowHeight = Console.LargestWindowHeight * 0.9

:D It's math. Multiple ways to do the same thing :)
hth,
Mythran


Oct 29 '08 #9


"Michael B. Trausch" <mi**@trausch.uswrote in message
news:20081029203203.15b43689@zest...
On Wed, 29 Oct 2008 19:19:36 -0400
"Michael B. Trausch" <mi**@trausch.uswrote:
>Also, it's not very portable; Windows is the only system where the
"console" has any notion of how large it can become on the given
display.

Furthermore (I should have mentioned this in my last post), setting the
Console width and height will throw System.NotSupportedException on
non-Windows platforms, i.e., using Mono. Not sure what Microsoft's
Rotor does on non-Windows platforms, but I suspect it would do the same
thing since there is no way to change the terminal size without the
user doing it manually.

--- Mike

--
My sigfile ran away and is on hiatus.
http://www.trausch.us/
Aye, thanks for the info/correction :)

Mythran
Oct 30 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
by: Dom | last post by:
can someone please help me display text in the console cout << "Testing"; in a different colour to the default one
2
by: Boba | last post by:
Hi, I'm programming a WinForm application. I would like to enter commands that will send output that will help me to locate bugs in the future. I know that there is a way to send output by...
2
by: Martín Marconcini | last post by:
Hello there, I'm writting (or trying to) a Console Application in C#. I has to be console. I remember back in the old days of Cobol (Unisys), Clipper and even Basic, I used to use a program...
2
by: PHead | last post by:
Is there any way to stop the console from scrolling? What I mean isnt to not scroll at all, its that I want to get rid of the buffer. When a new line is created, I want row 0 to go away...
1
by: cplusplusstudent | last post by:
Hello I am a new C++ programmer and am working with the Visual C++ studio. I am attempting to create a simple console application for myself but I fin that neither of the introductory C++ books...
0
by: F.C. | last post by:
Hello, :) I'm currently writing a frontend for a console application using VB .net. I'm using the traditional Process creation to launch it and redirect input and output to my windows...
6
by: Mythran | last post by:
Is it possible to attach Windows WndProc hooks into a Console application window? Thanks, Mythran
6
by: tony | last post by:
Hello! When you have windows forms you have the same possibility as when you have a Console application to use Console.Writeln to write whatever on the screen. Now to my question: Is it...
4
by: =?Utf-8?B?QWxleGFuZGVy?= | last post by:
Hi! I am new to C#. I read two C# books in the last two days which only covered the basics. And now I am on my third day. The books were really bad, because they did not cover windows applications,...
9
by: Nathan Sokalski | last post by:
I have a Console Application, and when I do a "Start Without Debugging" to test it, everything works, but it will not allow me to make the window wider than half my screen. Even if I maximize it,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.