H.B*_*.B. 39
对于主屏幕:
System.Windows.SystemParameters.PrimaryScreenWidth
System.Windows.SystemParameters.PrimaryScreenHeight
(请注意,还有一些其他主屏幕相关的属性,取决于各种因素,Full*&Maximised*)
虚拟屏幕:
SystemParameters.VirtualScreenWidth
SystemParameters.VirtualScreenHeight
小智 13
如果您想要运行程序的监视器的特定尺寸(如果某人正在运行多个监视器),您还可以使用:
var helper = new WindowInteropHelper(this); //this being the wpf form 
var currentScreen = Screen.FromHandle(helper.Handle);
这将返回一个屏幕对象,引用程序运行的监视器.从那里你可以使用currentScreen.Bounds.Width/ Heightproperty(对于完整大小)或currentScreen.WorkingArea.Width/ Height(减去任务栏等),具体取决于你想要的.