Search code examples
c#.netwinforms

How to fix the issue of controls shifting on high DPI?


I came across this Microsoft article on how to support high DPI in Windows Forms applications running on .NET Framework 4.7.

https://learn.microsoft.com/en-us/dotnet/framework/winforms/high-dpi-support-in-windows-forms

I followed those instructions and they did help me fix the blurring issue, but I still can't figure out a way to fix the controls shifting/moving.

I tried to place all controls in a TableLayoutPanel and adjust the anchors, but it didn't solve the issue.

So, is there a way to fix this issue?

PS: I'm using .NET Framework 4.7.2 and Windows 10 Pro 1909


Solution

  • Setting AutoScaleMode = Dpi solved the issue for me.
    Thanks to @Jimi