WPF 双监视器应用程序叠加 [英] WPF Dual Monitor Application Overlay

查看:75
本文介绍了WPF 双监视器应用程序叠加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我查看了此线程以在 WPF 中创建双监视器应用程序:http://social.msdn.microsoft.com/forums/en-US/wpf/thread/5d181304-8952-4663-8c3c-dc4d986aa8dd显示在两台显示器上.

I looked at this thread to create a dual monitor application in WPF: http://social.msdn.microsoft.com/forums/en-US/wpf/thread/5d181304-8952-4663-8c3c-dc4d986aa8dd where a WPF Window will be displayed on each of the two monitors.

我遇到的问题是窗口重叠 - 它们都显示在同一屏幕上.调试器告诉我 System.Windows.Forms.Screen.AllScreens 数组中有 2 个 Displays,并且每个屏幕的工作区域的 Top 和 Left 值分别为 0、-1600 和 0、0(这似乎是对我来说准确).

The issue I am having is that the windows are overlapping - they are both being displayed on the same screen. The Debugger tells me that there are 2 Displays in the System.Windows.Forms.Screen.AllScreens array and that the Top and Left values of the working areas of each screen are 0, -1600 and 0, 0 respectively (which seem to be accurate to me).

两个屏幕的分辨率均为 1600x1200.

Both screens have a resolution of 1600x1200.

有没有人遇到过类似的问题?显示器在屏幕分辨率设置中设置为将桌面扩展到此显示器".

Has anyone come across a similar issue before? The monitors are set to 'Extend desktop to this display' in the Screen resolution settings.

谢谢!

推荐答案

我使用以下代码设法在第二台显示器(位于主显示器的右侧)中显示了一个窗口:

I managed to display a window in the second monitor (placed at the right of the primary) by using the following code:

window.Left = System.Windows.SystemParameters.VirtualScreenWidth/2;

这篇关于WPF 双监视器应用程序叠加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆