0

I have a windows form program I have been maintaining for a number of years on a Windows 7 / VS2017 setup.

I recently migrated to Windows 10 and VS2019.

When I compile the program everything looked fine. But now when I make a change to any form, the form looks correct in the designer but is completley chnaged when I run the program. There is extra padding between all the controls.

If I simply add one control to a form, the designer.cs file has significant changes to it.

  • Every control location location changes
  • Every control size changes
  • Every control has a new padding property initializer added

However, it still looks exactly the same in the designer.

Does anyone know why this is happening and how to prevent it.

Here is a picture of the differences

https://www.smartire.com/images/Form_Diff.PNG

  • 2
    Maybe DPI is handled differently. Did you changed .NET framework version? – Posix Feb 25 '20 at 17:03
  • [How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?](https://stackoverflow.com/a/13228495/7444103) -- [High DPI support in Windows Forms](https://learn.microsoft.com/en-us/dotnet/framework/winforms/high-dpi-support-in-windows-forms) – Jimi Feb 25 '20 at 17:10
  • It should be one of the well known issues with WinForms designer. Hope Microsoft can fix that with the new .NET Core WinForms designer. So far my personal opinion is to manually revert certain changes made by the designer to keep consistency. – Lex Li Feb 25 '20 at 20:31

0 Answers0