Way 1. How Override high DPI scaling (check checkbox) with registry
Start up Registry Editor and navigate to this key:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
Now add a string value (REG_SZ) whose name is the full path to the application executable and whose value is HIGHDPIAWARE
Code example:
string appPath = string.Format(@"{0}\{1}.exe", My.Application.Info.DirectoryPath, My.Application.Info.AssemblyName);
My.Computer.Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers", appPath, "HIGHDPIAWARE");
Read more: High DPI Settings in Windows
Way 2. How to change DPI-aware in assembly manifest?
DPI-aware applications are not affected by the OS. Such applications render themselves to fit the actual DPI of a screen and provide a much better visual experience.
Add the <dpiAware>
element to the manifest code and set its value to true
.
<?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
Additional resources:
High DPI Support
High DPI Desktop Application Development on Windows (also Application Manifests)
DPI Awareness - Unaware in one Release, System Aware in the Other [duplicate]
Writing High-DPI Aware Windows Apps
Writing DPI-Aware Desktop and Win32 Applications
settings.CefCommandLineArgs.Add("force-device-scale-factor", "1");
– Helico