get information about all monitors
Published: 27. October 2011 | Updated: 27. October 2011License: Microsoft Public License (MS-PL)
Categories: Windows » Hardware
Tags: C# Hardware Windows Winforms
Import namespace
using System.Windows.Forms;
Code
Screen[] monitors = Screen.AllScreens; foreach (Screen monitor in monitors) { Console.WriteLine("Bits Per Pixel: {0}", monitor.BitsPerPixel); Console.WriteLine("Bounds: {0}", monitor.Bounds); Console.WriteLine("Device Name: {0}", monitor.DeviceName); Console.WriteLine("Is Primary: {0}", monitor.Primary); Console.WriteLine("Working Area: {0}", monitor.WorkingArea); }
| Send us feedback about this snippet » |





