Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
How to Calculate the Screen width and Height?:rose:
Posted

int width = Screen.PrimaryScreen.WorkingArea.Width;
int height = Screen.PrimaryScreen.WorkingArea.Height;

or
int width = Screen.PrimaryScreen.Bounds.Width;
int height = Screen.PrimaryScreen.Bounds.Height;

depending on what you actually want.
 
Share this answer
 
v3
Comments
Hiren solanki 6-Jan-11 8:39am    
Good answer toli.
SystemInformation.PrimaryMonitorSize;


or

SystemInformation.VirtualScreen;
 
Share this answer
 
Comments
Hiren solanki 6-Jan-11 8:40am    
Good call john.
Here you go: Goole Search Result for Screen width & Height[^]

Pick any link that you like and implement the same.
 
Share this answer
 
You can use the Screen class to find various properties of the systems monitors. To find the Width and heigth of your primary monitor you could do this:

C#
Screen[] screens = Screen.AllScreens;
int width = screens[0].Bounds.Width;
int height = screens[0].Bounds.Height ;


Hope this helps.
Happy coding :)
 
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