Noah
Noah

Reputation: 820

Application displays correctly on a 150% scaled monitor but not on a 100% one

I am currently developing an application in c# with .NET Framework 4.7 I have a problem with DPI scaling. On my computer I have two monitors, one with 150% scaling and another one with 100%. I added this code in my app manifest file:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
  <asmv3:application  xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
      <dpiAware>true</dpiAware>
    </asmv3:windowsSettings>
  </asmv3:application>
</assembly>

And it works perfectly fine.

What is looks like when correctly displayed

i take the exe file and all its dependecies, take it to another computer who as only one screen with 100% scaling and the application doesn't look as it should do.

What it looks when not correctly displayed

I hope you guys have a solution for me I am struggling since two days with this problem...

Upvotes: 1

Views: 321

Answers (1)

Noah
Noah

Reputation: 820

Well, like every time I post my problem I figure out the solution a few moments later.

I removed the manifest file from the application and changed the AutoScaleMode propertie to Dpi instead of Font for every form in my application.

And now it works like a charm.

Upvotes: 3

Related Questions