查找数和分辨率到所有的显示器 [英] 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?
推荐答案
在C#? 屏幕
类 表示单个系统上的显示设备或多个显示设备。您希望边界
属性。
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());
}
这篇关于查找数和分辨率到所有的显示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文