2

I am coding a C++ project using MFC in Visual Studio (v16.5.4). The dialog editor seems badly broken on my HiDPI monitor (Lenovo ThinkVision 2880x1800 at 175%). It works fine on two other computers with standard monitors.

The dialogs get resized apparently randomly, and controls do not move correctly when I try to edit them. When I try to align controls the dotted selection rectangle may move, but the control often does not (in the editor). Sometimes, re-opening the editor shows that the control has in fact moved. When I build the project, the final display layout cannot be predicted from what appears in the resource editor.

I reported this to Microsoft using Visual Studio feedback, but they closed the report, saying it was "By design"!!!! They posted a link describing a feature which disables HiDPI awareness, but the link was for the Windows Forms Designer, not the MFC resource editor - there is no equivalent feature in the latter that I could find.

Does anyone else have this problem, or know of a decent work-around? At the moment I am transferring to my other computer with the standard display whenever I need to edit a dialog, which is monumentally inefficient for quite a large project.

Bill Heitler
  • 187
  • 3
  • 13
  • 1
    I'm suffering the same issue, but with opposite outset. My laptop display is 3000x2000 pixels, with the external monitor being your average 1920x1080 standard resolution and pixel density. The visual resource editor is broken to the point of being unusable on either display. Can you post a link to the Visual Studio feedback report, so that we can have it re-opened? – IInspectable Apr 16 '20 at 16:41
  • 1
    Here is the link: https://developercommunity.visualstudio.com/content/problem/816317/dialog-editor-broken-on-hi-dpi-monitor.html – Bill Heitler Apr 16 '20 at 17:01
  • 1
    I actually tried to report this twice. The first time it was closed as a "duplicate" - but it wasn't, the original feedback was about running the compiled program, whereas mine was about developing the dialogs in the editor. The second time it was closed as "by design" as descibed in my post here. – Bill Heitler Apr 16 '20 at 17:03
  • 1
    I would be DELIGHTED if you could get the problem re-opened. As you say, the editor is unusable as it currently stands. – Bill Heitler Apr 16 '20 at 17:13
  • Same problem here! When using two monitors (regardless which resolution) the dialog editor is broken. Has anyone found a solution for this? My current workaround is to switch to ‚one monitor only‘ when I need to use the dialog editor, but this of course a waste of time… I‘m using VS2022. – LaborEtArs Feb 07 '22 at 19:32

2 Answers2

0

I know this is an older post, but I thought what I found might help someone. I experienced the same issue today. It just happens that I have one monitor setup for 125% and one setup for 100%. The MFC dialog editor alignment operations do not work correctly on the 125% monitor but work fine on the 100% monitor. It would appear Microsoft isn't properly handling DPI in the dialog editor.

0

I have had the same problem with an external monitor resolution of 3840 x 2160 and the scaling set to 175%. During my search I found an interesting setting in VS 2019 (16.11.27) which seems to be the cause. Under the VS 2019 menu TOOLS | Options | Environment | General | “Optimize rendering for screens with different pixel densities” when selected this causes the resource editor problems, when switched off the resource editor works on a scaled monitor as well. According to MS the setting helps the code font to be sharper (font becomes a bit blurred when switched off). This may help some searching for the problem!

Gismo
  • 1