M
M
Melz2018-10-27 22:51:23
WPF
Melz, 2018-10-27 22:51:23

WPF, how to disable scaling when changing monitor DPI?

Good afternoon,
tell me how to disable program scaling in WPF when the user changes the screen settings from 100% to 125%, for example.
The program is positioned on the screen by X,Y and width/height. They need to remain unchanged.
Those if on one monitor it is 100%, and on the other 125%, then the windows should be the same size if placed at the edges of the monitors.
Tried in different combinations:

<windowsSettings>
    <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">false</dpiAware>
</windowsSettings>

and
[assembly: System.Windows.Media.DisableDpiAwareness]

The desired result is achieved by the Windows compatibility settings on the right button, but I did not find how to enable it in the code.
5bd4c199a8727705139371.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question