logo WinWrap®

WinForms and High DPI Monitors

.NET 4.0 WinForms High DPI

  • Add an app.manifest file
  • Modify the app.config file

.NET 4.0 WinForms and High DPI Monitors

The High DPI support for WinForms is a mess. Microsoft requires these modifications to the project:

  1. In the project's app.config file insert these lines before the </configuration> line:
      <add key="EnableWindowsFormsHighDpiAutoResizing" value="true"/>
  2. Add a new app.manifest file to your application's project (Ctrl+Shift+A) and then uncomment these lines:
    <application xmlns="urn:schemas-microsoft-com:asm.v3">
        <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
  3. Never run Visual Studio with a Screen resolution other than 100%. That will screw up the forms editor. (You probably aren't doing that, but I mention it for completeness.)
  4. Copyright Polar Engineering, Inc.