Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-03-03
5
Medium Priority
?
963 Views
Last Modified: 2012-06-27
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 ??
0
Comment
Question by:Parth48
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 35024886
You would use:
            int screen_width = Screen.PrimaryScreen.Bounds.Width;
            int screen_height = Screen.PrimaryScreen.Bounds.Height;

Open in new window

0
 
LVL 8

Expert Comment

by:jimsweb
ID: 35024902
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
0
 
LVL 10

Expert Comment

by:Asim Nazir
ID: 35024982
0
 
LVL 14

Expert Comment

by:Dhanasekaran Sengodan
ID: 35025559
0
 
LVL 15

Expert Comment

by:Russell_Venable
ID: 35035515
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;
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question