Link to home
Start Free TrialLog in
Avatar of Parth48
Parth48Flag for India

asked on

how can i get screen width and height in my C#.net window application ??

i want to know that how can i get screen width and height in my C#.net window application ??
because i want to use it in form location ...

for ex.

       
 Form objForm = this.findform();
        objForm.Location = new Point(screen_width / 4 , screen_height / 4);

Open in new window


so can u tell me how can i get screen width and height in my C#.net window application ??
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Though the below link doesn't directly deal with your question, I am pretty sure that it has answer that you are looking for. :)

http://social.msdn.microsoft.com/Forums/en/Vsexpressvcs/thread/aba4d7cb-8114-4018-bff0-582756c0ae70
Why not just  this.width and this.height as anonymous calls to the application. It's one the ways I use to dynamically change the shape/size of my applications or controls.

This will authomatically inherit your main windows methods. So you can define them like so
this.Height = 220;
this.Width = 220;

Simple enough or grab the values.

Double saveHeight = this.Height;