指定我的应用程序应打开哪个屏幕(Specifying which screen my application should open on)

编程入门 行业动态 更新时间:2024-10-26 20:33:48
指定我的应用程序应打开哪个屏幕(Specifying which screen my application should open on)

我创建了两个WPF应用程序,旨在使用双显示器在同一台服务器上全屏运行。

是否可以指定在哪个屏幕上打开哪个应用程序?

我目前在不同的监视器桌面上有可执行文件,但是理想情况下我想以编程方式控制它。

如果那是不可能的,那么我可以将应用程序移动到WPF Web客户端并在两个全屏Internet Explorer窗口中打开,但我再次需要指定哪些加载在哪些屏幕上。

谢谢

I've created two WPF applications that are designed to run full screen on the same server with dual monitors.

Is it possible to specify which application opens on which screen?

I currently have the executable on different monitors desktop which works but ideally I'd like to control this programmatically.

If that isn't possible, then I could move the application into a WPF web client and open in two full screen Internet Explorer windows but again I'd need to specify which ones load on which screens.

Thanks

最满意答案

您必须将两个exe的Window.StartupLocation设置为手动,然后您必须手动将Window.Top和Window.Left设置为您希望每个显示的监视器的坐标。

您可能希望使用Screen类来确定每个屏幕的位置

http://msdn.microsoft.com/en-us/library/system.windows.forms.screen.aspx

You will have to set the Window.StartupLocation to manual for both of your exe's and then you will have to manually set the Window.Top and Window.Left to the coordinates for the monitor you want each to show up on.

You will probably want to use the Screen class to determine where each screen is at

http://msdn.microsoft.com/en-us/library/system.windows.forms.screen.aspx

更多推荐

本文发布于:2023-07-30 22:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1340298.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   屏幕   screen   application   open

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!