简体   繁体   English

WPF应用程序窗口未在第二个监视器上缩放

[英]WPF application window not scaled on second monitor

My WPF application window is not scaled on the second monitor, running Windows 10.1607. 我的WPF应用程序窗口未在运行Windows 10.1607的第二台显示器上缩放。 The built-in monitor runs at 200% (high DPI) and the external monitor at 100% scaling. 内置监视器以200%(高DPI)运行,而外部监视器以100%缩放比例运行。 Most other program windows change their size and internal scaling when they are moved between monitors, but mine does not. 大多数其他程序窗口在监视器之间移动时会更改其大小和内部缩放比例,但我的不会改变。 It appears huge on the external monitor, and has double the icon and text size compared to correct scaling. 它在外接显示器上显得很大,与正确缩放比例相比,其图标和文本大小增加了一倍。

The application targets .NET Framework 4.0 and the app.manifest file contains the relevant entries for Windows 10 support and dpiAwareness. 该应用程序面向.NET Framework 4.0,而app.manifest文件包含Windows 10支持和dpiAwareness的相关条目。 Even if I remove these entries, it doesn't change. 即使删除这些条目,它也不会更改。 I don't know whether this has worked before, I couldn't find an old version that does. 我不知道这是否曾经奏效,我找不到能做到的旧版本。

What do I need to do to let Windows scale my window on a different-DPI monitor just as any other window? 我该怎么做才能让Windows在其他DPI监视器上像其他窗口一样缩放我的窗口? I don't currently expect it to be sharp (.NET 4.6.2 has news to that), blurry rescaling is okay. 我目前不希望它过于尖锐(.NET 4.6.2对此有消息),模糊的缩放比例还可以。 But it just needs to do anything and not render the window at 200% on a 100% monitor. 但是它只需要执行任何操作,而不需要在100%的显示器上以200%的比例渲染窗口。

Seems to be a Windows/Surface bug. 似乎是Windows / Surface错误。 Every time I resume the Surface Pro 4 (all updates installed) from standby, a number of applications are not rescaled when moved to another monitor. 每次我从待机状态恢复Surface Pro 4(已安装所有更新)时,许多应用程序在移至另一台显示器时都不会重新缩放。 After a logoff and logon, it works normally again. 注销并登录后,它可以再次正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM