Solved

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

Posted on 2011-03-03
5
907 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
5 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
0
 
LVL 14

Expert Comment

by:Dhanasekaran Sengodan
Comment Utility
0
 
LVL 15

Expert Comment

by:Russell_Venable
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
C# SQL BULK INSERT CLASS 5 34
Limiting string to two deciamls 18 30
Asp.net mvc 5 5 15
Copy/Clone an object. 9 10
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now