Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

C#
 private void MC_Load(object sender, EventArgs e)
        {
            this.Width = 1285;
            this.Height = 950;
            Point p = new Point(0, 0);
            this.Location = p;

}
Posted
Comments
Philippe Mori 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.

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.
 
Share this answer
 
Comments
Espen Harlinn 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900