How do I fix DPI scaling issues for Visual Studio 2017 Windows Forms

14,348

Solution 1

I have similar problem when working with Windows Forms (Windows Forms Designer) on Visual Studio 2017, but I think it would be the same on Visual Studio 2019.

From Microsoft documentation here, there is a tip to disable the scaling/DPI aware feature.

If you prefer to manage settings from the command line, devenv.exe takes /noscale as a command-line parameter to run in 100% scaling mode.

So, basically, I just created a shortcut on the Desktop to Visual Studio (devenv.exe) and added the parameter /noscale on the shortcut Target field like so:

"...\path\to\IDE\devenv.exe" /noscale

So, everytime Visual Studio is started through the shortcut, it will always start with 100% scaling mode. If you use high resolution screen (high-dpi) screen, you will notice that the Visual Studio text will appear a little bit blurry because of this.

Solution 2

You should change the settings so there won't be a difference when the program runs on different machines. Go to the project's properties page, then to Manifest Tool and then Input and Output. Change the DPI awareness to 'none' enter image description here

Share:
14,348

Related videos on Youtube

F43G4N
Author by

F43G4N

Updated on October 16, 2022

Comments

  • F43G4N
    F43G4N over 1 year

    I've been encountering this issue ever since I bought this laptop with 4k display in 2015. With a lot of effort I managed to work around the issue but I'm growing tired of it. VS2017 is supposedly DPI aware hence I do not expect any issues when creating a simple MDI Parent Form and running the app. But to my frustration the icons in the toolStrip (just the standard one in the MDI parent form) are scaled horribly. When I create a form with a button on it which looks just fine in Visual Studio 2017 designer and I run the app and load the form, the button text isn't completely shown. My display settings are as follows:

    • Resolution: 3840x2160
    • Scaled 250% (in display settings) because at 100% everything is unreadable

    I've tried to find solutions, but the only workable thing I could find was setting my visual studio designer to dpi-unaware via registry (link here)

    Help anyone?

    Update When I add a new MDI form with the setting of DPI-awareness OFF, everything looks OK except Visual Studio itself (blurry).