C#中:获取完整的桌面大小?大小、桌面、完整

2023-09-02 11:51:44 作者:渐行渐远渐陌生

我如何找出整个桌面的大小? 不会工作区和不可以在屏幕分辨率,这两者是指只有一个屏幕。我想找出虚拟桌面其中每个监视器是显示仅一部分的总宽度和高度。

How do I find out the size of the entire desktop? Not the "working area" and not the "screen resolution", both of which refer to only one screen. I want to find out the total width and height of the virtual desktop of which each monitor is showing only a part.

推荐答案

您有两种选择:

presentationFramework.dll

SystemParameters.VirtualScreenWidth   
SystemParameters.VirtualScreenHeight

System.Windows.Forms.dll中

SystemInformation.VirtualScreen.Width   
SystemInformation.VirtualScreen.Height

使用的首选项的,如果你开发一个WPF应用程序。

Use the first option if you developing a WPF application.