5

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).

F43G4N
  • 159
  • 1
  • 1
  • 9
  • You are getting a preview of what your UI design will look like on another machine that doesn't have a fancy monitor. It is an inconvenient truth, state your install requirements explicitly and [declare your app to be dpiAware](https://stackoverflow.com/a/13228495/17034). – Hans Passant Aug 09 '18 at 09:55
  • Possible duplicate of [How to write WinForms code that auto-scales to system font and dpi settings?](https://stackoverflow.com/questions/22735174/how-to-write-winforms-code-that-auto-scales-to-system-font-and-dpi-settings) – magicandre1981 Aug 09 '18 at 15:25
  • To make VS2017 NOT blurry, see my answer here: https://superuser.com/a/1452352/433287 – aoetalks Jun 24 '19 at 15:04
  • I think I found the same issue...I eventually noticed the ImageScalingSize of the toolbar was set to 32,32 (and sometimes 28,28 and sometimes something completely random!). Set them all back to 16,16 and hey presto, all good again. Quite what caused this I haven't yet discovered. HTH – AndrewD Jul 14 '19 at 12:29

2 Answers2

4

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.

Aryo
  • 4,349
  • 2
  • 28
  • 24
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

Michael Haephrati
  • 3,660
  • 1
  • 33
  • 56