Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,873 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In the display settings of Windows 10, you can set the scaling ratio (for example: 125%, 150%). Please note that it is not the DPI value. How to get this value using C#.
For example with GetDpiForWindow
with a Manifest to get right results:
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor</dpiAwareness>
</windowsSettings>
</application>
I get :
96 for 100%
120 for 125%
144 for 150%
etc...