Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to change the application's window size according to the resolution size of any monitor in C#

i have done a windows application and also i created a setup file for the same application in VS studio 2005.
When i install the application in any other system, the window state is maximised but i can only see, half of the side of my real window with controls which i use to see in my development system.
What can i do to change the windows size and controls present in the window to automatically change according to screen resolution of any system.s montior where i install my window's application

i came to know that SCREEN class in .Net will be helpful but not able to get any idea/conclusion with that class

i have developed in C# 2.0

intX = Screen.PrimaryScreen.Bounds.Width;
intY = Screen.PrimaryScreen.Bounds.Height;

u can use above code get screen width and height

and then pass intx and inty to screen

this.Width = intX ;
this.Height = intY ;

but for controls u have use some other way like Anchor codings.
pls refer following link

Share this answer
System.Drawing.Rectangle workingRectangle = 

This will fetch you the working area Height and width for the monitor.

int widthVal=workingRectangle.Width;
int heightVal=workingRectangle.Height;

Best of luck.
Share this answer

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