Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find Number and resolution to all monitors

How would one poll windows to see what monitors are attached and what resolution they are running at?

like image 672
Crash893 Avatar asked Oct 08 '09 15:10

Crash893


People also ask

How can I check how many monitors are connected?

The quickest way to check if your Windows 10 computer supports multiple monitors is to go Settings, select System, and then Display. Scroll down and check if the Multiple displays option is available. If this is the case, this means that your machine supports multiple monitors.

How do I make all my monitors the same resolution?

Change settings from graphics configuration software Navigate to Desktop Properties. Select the desired monitor and choose the suitable resolution. Click Apply to save changes. Now do the same for the other monitor.


2 Answers

In C#: Screen Class Represents a display device or multiple display devices on a single system. You want the Bounds attribute.

foreach(var screen in Screen.AllScreens) {     // For each screen, add the screen properties to a list box.     listBox1.Items.Add("Device Name: " + screen.DeviceName);     listBox1.Items.Add("Bounds: " + screen.Bounds.ToString());     listBox1.Items.Add("Type: " + screen.GetType().ToString());     listBox1.Items.Add("Working Area: " + screen.WorkingArea.ToString());     listBox1.Items.Add("Primary Screen: " + screen.Primary.ToString()); } 
like image 122
Joe Koberg Avatar answered Sep 18 '22 20:09

Joe Koberg


Use the Screen class.

You can see all of the monitors in the Screen.AllScreens array, and check the resolution and position of each one using the Bounds property.

Note that some video cards will merge two monitors into a single very wide screen, so that Windows thinks that there is only one monitor. If you want to, you could check whether the width of a screen is more than twice its height; if so, it's probably a horizontal span and you can treat it as two equal screens. However, this is more complicated and you don't need to do it. Vertical spans are also supported but less common.

like image 23
SLaks Avatar answered Sep 18 '22 20:09

SLaks