This is something I had a lot of trouble with. After days of experimenting, I finally figured out how to properly scale WinForms. This might help some other folks too.
There are a lot of recommendations of modefying the app.manifest or app.config files. The solution might have worked with earlier versions of Windows, but none worked for me. After installing my application, pictures and controls got messed up (in Visual Studio debugging it all worked). After some testing, I had seen that changing the "overwrite high dpi scaling" option setting to "application" worked for me. But I wanted to support this right within the app and not modifying some Windows settings.
I stumbled across a Windows support document explaining, that they have changed some DPI scaling with the latest release of Windows and old methods might not work.
All you actually have to do is following these steps:
</startup>
and <userSettings>
, insert the following snippet<System.Windows.Forms.ApplicationConfigurationSection>
<add key="DpiAwareness" value="PerMonitorV2" />
</System.Windows.Forms.ApplicationConfigurationSection>
Application.EnableVisualStyles()
That's it! Your app should be looking great in 4K environment after installing on a machine. For further reference, please see this article from Microsoft.