Using the WinForms designer on high‑DPI systems

A couple of registry hacks to use Visual Studio's WinForms designer on high‑DPI systems without causing problems for the rest of your team.


The WinForms designer works best if it is always used with the same DPI settings. This generally means that all team members working on a WinForms project will need to standardize on 96 DPI when using the designer. However, with the recent popularity of ultra-high resolution laptops running at high scaling factors, it's increasingly common to find teams using a mix of different DPI settings. This causes all sorts of issues, and makes working on WinForms projects an absolute nightmare.

As far as I'm aware, there aren't any good solutions at the moment. The best workaround is to disable DPI awareness in Visual Studio for users who aren't running at 96 DPI. This has an annoying side-effect of making Visual Studio look a bit ugly and blurry, so I only recommend doing it when working with the WinForms designer, and then swapping back for all other work.

I've provided a couple of registry scripts to disable and re-enable DPI awareness for Visual Studio. Please note that you'll have to restart Visual Studio for these scripts to take effect.

Disable DPI awareness:

Use this script on high-DPI systems to disable DPI awareness before working with the WinForms designer.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\devenv.exe]
"dpiAwareness"=dword:00000000

This script can be downloaded here.

Enable DPI awareness:

Use this script on high-DPI systems to revert back to normal DPI awareness once you're done working with the WinForms designer.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\devenv.exe]
"dpiAwareness"=dword:00000001

This script can be downloaded here.


Posted by Matthew King on 19 August 2018
Permission is granted to use all code snippets under CC BY-SA 3.0 (just like StackOverflow), or the MIT license - your choice!