Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 size Forms
I developed an application in C#2010 in my PC. it have many forms .I have defined the forms size (width=1285,Height=950) in the code ,and in the size property of Forms . this worked fine for the PC in which I developed the Application. but when I install the application to another PC which is having different monitor resolution and different monitor size the form is not displayed properly. some portion of the form not visible.
 
how I can make the form to fit to any PC,Monitor irrespective of its size or resolution.the code I used is shown below
 
 
 private void MC_Load(object sender, EventArgs e)
        {
            this.Width = 1285;
            this.Height = 950;
            Point p = new Point(0, 0);
            this.Location = p;
 
}
 
Posted 31-Oct-11 4:50am
Comments
Philippe Mori at 31-Oct-11 18:17pm
   
You should design for smaller supported screen size. If the resolution is lower than that, then scrollbar could be used.
 
1024x768 minus borders and taskbar would generally be the maximum dimension you should uses. The heigh is further reduced, if you plan to support netbooks.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Always design your forms to a minimum specification of screen size and then use the anchors, alignments as Mehdi suggests to help the form resize properly. It is always easier to scale up a design than to scale down which is why I suggest you do it this way.
  Permalink  
Comments
Espen Harlinn at 31-Oct-11 16:12pm
   
Good advice, Marcus :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,192
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 31 Oct 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100