WPF全屏应用程序-多台监视器
|
我的WPF应用程序中使用了多个监视器。该应用程序以全屏模式运行,并且我希望能够在用户按下按钮时切换到哪个监视器。
case Key.M:
var allScreens = System.Windows.Forms.Screen.AllScreens.ToList();
if (this.CurrentScreen < allScreens.Count - 1)
{
this.CurrentScreen++;
}
else { this.CurrentScreen = 0; }
this.WindowStartupLocation = System.Windows.WindowStartupLocation.Manual;
this.Top = allScreens[this.CurrentScreen].Bounds.Top;
this.Left = allScreens[this.CurrentScreen].Bounds.Left;
break;
我正在尝试这样做,但是this.Left始终具有(-7)的值。我假设它不让我设置它是因为我全屏显示,但我不确定100%。我如何才能全屏切换到另一台显示器?
没有找到相关结果
已邀请:
1 个回复
镰茧钩
它的工作没有任何不良影响。刚刚测试过。