[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to determine the screen resolution of an application when using more than 1 screen

Posted on 2009-12-18
4
Medium Priority
?
334 Views
Last Modified: 2013-11-23
Hi

Is it possible to determine the screen resolution of the screen your application is running in when using more than one screen. For example, I'm using dual display in Windows, screen1 and screen2.  Screen1 has a resolution of 1680 x 1050 and screen2 has a resolution of 1024 x 768.  When I run my application it will start in screen1, but then I move it to screen2.  In my code I use Screen.Width / Screen.Height which returns the values of screen1 and not screen2.  I need to get the resolution of the screen the application is running in?

Thanks
0
Comment
Question by:ruanlab123
4 Comments
 
LVL 26

Expert Comment

by:tigin44
ID: 26078508
by using the

Screen.Width
Screen.Height

you may get the current resolution of the screen
0
 
LVL 13

Accepted Solution

by:
ThievingSix earned 1200 total points
ID: 26078557
 //Monitor 1
  Screen.Monitors[0].Width;
  Screen.Monitors[0].Height;
  //Monitor 2
  Screen.Monitors[1].Width;
  Screen.Monitors[1].Height;
  //Number of monitors
  Screen.MonitorCount;
0
 
LVL 12

Assisted Solution

by:Hypo
Hypo earned 800 total points
ID: 26078671
And to get the monitor of your form (or whatever you are using) you can use any of the functions:

Screen.MonitorFromWindow(Form1.Handle);
Screen.MonitorFromRect(Form1.BoundsRect);
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses
Course of the Month19 days, 19 hours left to enroll

873 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