WinForms - Update app.manifest to PerMonitorV2

- Update app.manifest
- Update comment in Program.cs
This commit is contained in:
Alex Maitland 2022-06-20 11:03:18 +10:00
parent 1d99718498
commit ed5adfc787
2 changed files with 13 additions and 4 deletions

View File

@ -19,7 +19,10 @@ namespace CefSharp.MinimalExample.WinForms
CefRuntime.SubscribeAnyCpuAssemblyResolver(); CefRuntime.SubscribeAnyCpuAssemblyResolver();
#endif #endif
//For Windows 7 and above, best to include relevant app.manifest entries as well // Programmatically enable DPI Aweness
// Can also be done via app.manifest or app.config
// https://github.com/cefsharp/CefSharp/wiki/General-Usage#high-dpi-displayssupport
// If set via app.manifest this call will have no effect.
Cef.EnableHighDPISupport(); Cef.EnableHighDPISupport();
var settings = new CefSettings() var settings = new CefSettings()

View File

@ -33,10 +33,16 @@
</requestedPrivileges> </requestedPrivileges>
</security> </security>
</trustInfo> </trustInfo>
<!--
Enable DPI Awareness.
For those targeting .Net 4.7 or greater then configuring via app.config is recommended by Microsoft.
https://docs.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8#configuring-your-windows-forms-app-for-high-dpi-support
-->
<asmv3:application> <asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> <asmv3:windowsSettings>
<dpiAware>true/PM</dpiAware> <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
</asmv3:windowsSettings> </asmv3:windowsSettings>
</asmv3:application> </asmv3:application>