473,403 Members | 2,222 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,403 software developers and data experts.

Maximize a Winform Width

Probably an easy question but here goes:

A 2.0 winform.

How (on startup) should I properly make the width, the max of the user's
screen?

...

Apr 5 '07 #1
3 2681
Screen.PrimaryScreen.WorkingArea

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"sloan" <sl***@ipass.netwrote in message
news:ej**************@TK2MSFTNGP04.phx.gbl...
Probably an easy question but here goes:

A 2.0 winform.

How (on startup) should I properly make the width, the max of the user's
screen?

..

Apr 5 '07 #2
Thanks Kevin.
"Kevin Spencer" <un**********@nothinks.comwrote in message
news:u5*************@TK2MSFTNGP05.phx.gbl...
Screen.PrimaryScreen.WorkingArea

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"sloan" <sl***@ipass.netwrote in message
news:ej**************@TK2MSFTNGP04.phx.gbl...
Probably an easy question but here goes:

A 2.0 winform.

How (on startup) should I properly make the width, the max of the user's
screen?

..



Apr 6 '07 #3
In a single-monitor context it's reasonably simple:

myForm.Width = Screen.PrimaryScreen.Bounds.Width;
or
myForm.Width = Screen.PrimaryScreen.WorkingArea.Width;

(the above widths can be different, you need to decide which one to use).

In a multi-monitor contet it's more complex, you'll need to define what your
requirements are. Should the width be the width spanning all monitors or a
single monitor? If it's a single monitor, what's the criteria for choosing
which monitor?

--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
"sloan" wrote:
Probably an easy question but here goes:

A 2.0 winform.

How (on startup) should I properly make the width, the max of the user's
screen?
Apr 8 '07 #4

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

Similar topics

10
by: MJB | last post by:
In the main function of my form I check to see if the application is already running. If it is, I throw up a message box telling the user. What I would like to do is also maximize the...
8
by: jrefactors | last post by:
I want to maximize the browser window when I open a new window. Now I do the following, but different monitor size will yield different width and height values. ...
4
by: lauren quantrell | last post by:
I have an Access 2K popup form to which I have added buttons to run DoCmd.Maximize The problem is the form opens full height on the screen, with the bottom of the form hidden under the Windows...
7
by: Bhargavan | last post by:
Hey Group, When I minimize and then maximize a form (in windows application), I see a significant drop in memory usuage in the task manager. I tried to do the same thing programatically during the...
1
by: Hercules Dev. | last post by:
hi all, I developed a winform control and succeeded in hosting it in my ASP.Net application, I used the default way which is installing my winform control in the same directory of my ASP.Net...
3
by: guy | last post by:
VB2005 I have an MDI application, which displays modal forms correctly, and starts up with the MDI form maximized however for non modal forms behavious is unusual all forms have MaximizeBox,...
6
by: randy1200 | last post by:
I'm using Visual Studio 2005 and C#. I need to print a WinForm used for data entry as a graphic. In other words, I need to print the exact WinForm the user sees on the screen. I searched through...
1
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
I have a Winform (Composite UI Application Block) application that works great. Users have discovered that double-clicking any window title bar in Microsoft Windows XP is the same as clicking the...
2
by: rannajeesharma | last post by:
i got the following code from the forums but it not give the same effect like clicking maximize button <script language="javascript"> window.moveTo(0,0); window.resizeTo(screen.width,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.