none
Visual Studio Forms Designer on High Resolution Platform

    Question

  • I have just installed Visual Studio 2015 Community on my Windows 10 Surface Pro 4.  I develop old-fashioned programs for windows forms; I have been using Visual Studio since 2003, and am now using VS 2010.  In the Visual Studio forms designer on low-res platforms  I see the form exactly as it will appear in the executable - I can count pixels.  In VS on a high-res platform the form appears scaled down, and the relationship between controls and placement is unpredictable.  When I import old projects from VS 2010, the forms are all compressed with controls on top of each other, and I cannot work with them.  When developing new projects, I have been unable to control the appearance of the form in the executable.  So, I have found Visual Studio unusable for my development, and I have gone back to VS 2010, Windows 7 on a 1400x900 monitor.  Is there some setting or option to make the Visual Studio 2015 designer work in a WYSIWYG mode independently of the system resolution and scaling factor?

    Thanks,




    • Edited by wfaz2 Friday, January 15, 2016 4:47 PM
    Saturday, January 09, 2016 6:49 PM

All replies

  • Hi wfaz2,

    Thanks for your post.

    Could you please share us a screenshot of the UI which you feel not correct.

    I did a test in my side using VS2010 and VS2015. The behavior in both two VS are correct.

    I create a Windows form application in VS2010 and then run in VS2010 and in VS2015.

    In VS2010:

    In VS2015

    In addition. Please try to create a new Windows Form application in VS2015 then try it again.

    If still have the problem occurred. I suppose whether there is something wrong with your Visual Studio.

    In this case, try to run your VS2015 with logging turned on (devenv /log) in Developer Command Prompt for VS to check if there exist some error in log files

    The logs will be in: %APPDATA%\Microsoft\VisualStudio\Version\ActivityLog.xml

    Or you may need to try to repair your Visual Studio or install VS2015 update1 then try it again.

    By the way. Make sure the VS2015 and your VS2015 installed in same machine.

    I suppose whether the screen resolution affect it.

    Best Regards,

    Lake Xiao

    Tuesday, January 12, 2016 4:10 AM
    Moderator
  • Hi Lake,

    Thanks for your reply.  I have been chasing my tail on this for a few days now.  I now think this problem is due to the Surface Pro 4, not to VS2015.  I have tried a number of combinations (and mostly lost track of the details): VS2015 Community and VS2013 Express on the Surface Pro 4 running Windows 10, VS2012 Express on a Lenovo running Windows 8 and VS2010 Express on a Lenovo running Windows 7.  VS projects can be transferred between the two Lenovos running Windows 7 & 8 with various combinations of Visual Studio; however, projects that work fine on the Lenovo PCs running Window 7 & 8 show squished forms (smaller than the width, height properties with controls all compressed together) on the Surface whether using VS2015 or VS2013.  I don't know whether it is a Windows 10 issue, a Surface issue, a screen resolution issue or a Visual Studio issue.  The compiled programs run perfectly on any tested platform and OS.  It seems like I could get a new project on the Surface to behave properly with designer forms matching run time screens, but I can't abandon 10 man-years of software developed on previous versions of Visual Studio running on a host of PCs and laptops.  I cannot figure out how to get this work moved to the Surface Pro 4 running ANY version of Visual Studio.   Any further help would be greatly appreciated.  I will also keep searching for information now that (I think) I have a better understanding of the problem.

    More info ... I have set the display scaling of the Surface Pro 4 to 100% and now the entire form displays in the IDE designer, but Visual Studio menus are tiny.  Seems like I need a way to set the general display scaling to control the appearance of Visual Studio without have the forms scaled in the designer.  I guess this whole problem is due to the high resolution of the Surface Pro 4 display and, possibly, lack of features in Visual Studio to deal with it.  I need to run the Surface with 200% scaling so Visual Studio and other apps are usable, but I need the forms designer to intelligently deal with the scaling by showing vertical and horizontal scroll bars instead of squishing my forms into a garbled mess.




    • Edited by wfaz2 Thursday, January 14, 2016 6:23 PM
    Thursday, January 14, 2016 5:11 PM
  • I have windows form projects developed on previous versions of Visual Studio, and I am attempting to continue development of these projects using Visual Studio 2015 on a Microsoft Surface Pro 4.  The Surface Pro 4 recommending screen scaling is 200%; below that it is very difficult to use with the touch pad and impossible to use as a tablet (without keyboard or touch pad).  At 200% scaling, Visual Studio and other apps look great; however, the forms designer in Visual Studio takes my forms and turns them into a garbled mess with controls squished together and on top of each other.  The form itself seems to be scaled, but the controls, fonts, etc. are not scaled.  Moreover, I don't want the form to be scaled: I want what you see is what you get - pixel by pixel. Is there a way to option Visual Studio so that the forms designer does not scale the forms that were developed on VS2010/12/13 on lower resolution devices, but instead shows the forms in the designer at the size they were designed with horizontal and vertical scrollbars if needed.  The display resolution on the Surface has to be 200% in order to use Visual Studio.
    Thursday, January 14, 2016 8:31 PM
  • Hi wfaz2,

    Thanks for your quick response.

    If you are sure the problem is not in your VS2015. And the cause of the issue is more related to the Windows 10 Surface Pro 4.

    Since I have no such environment to reproduce your issue. And if the problem is related to your windows system.

    May be you could post it to the windows forum for better support.

    By the way, if you have any update and resolution to this issue, please also share here, thanks.

    Thanks for your understanding.

    Best Regards,

    Lake Xiao

    Friday, January 15, 2016 8:14 AM
    Moderator
  • I'm having the same issue. Using a SP4, VS2015 Community.

    When I create a 2000x1400 WinForm in the IDE, it looks fine. When I run the app, the form shrinks to approximately 1/2 the res of the screen (~1400x900, I think), and any controls that are larger than that are cut off.

    I've made things work by messing with the margins, but I would like to know why this is happening, and what to do to fix it.

    I'm pretty sure it has something to do with the high DPI of the SP4 screen, but messing with all of the DPI scaling options didn't really fix anything for me.

    Friday, January 15, 2016 9:31 AM
  • Hi Lake,

    I did post to the Windows forum ... I received one response: that person told me to post on this forum. Understand that I don't know whether the root cause of my problem is the hardware, the OS, Visual Studio, or what.  I have a new OS (Windows 10), a new PC (Surface Pro 4), and a new version of Visual Studio.  All I know is I spent a lot of time and money on a Microsoft development environment and, right now, I cannot develop.  It is totally useless.

    Friday, January 15, 2016 4:28 PM
  • Hi Developer_APCP,

    You can set the scaling on the Surface Pro 4 to 100%, and you will be able to see your form and controls, but the entire environment - menus, form, code and all - is so tiny that it cannot be used.  If you set the scaling to 200% as recommended by the Surface Pro setup menus, everything scales nicely except for the forms in the designer.  In my opinion, this is a problem with Visual Studio.  In Visual Studio, the platform scaling is being applied in the forms designer, but it is only affecting the form itself because the user has established font sizes, width and height for the controls.  The Visual Studio developers need to rethink their IDE: platform scaling cannot be applied in the forms designer.  The forms designer must always be what-you-see-is-what-you-get.  So what forum do we need to be using???  This thread should probably be posted with a new title: "Visual Studio Does Not Work on Hi-Resolution Systems".

    Regards, Bill

    • Edited by wfaz2 Friday, January 15, 2016 5:44 PM clarification
    Friday, January 15, 2016 4:35 PM
  • Hi,

    @ wfaz2

    did you try setting the AutoScaleMode of the Form(s)/UserControl(s) to Dpi? [And also the AutoScaleBaseSize to the correct value (should be done automatically)]

    Regards,

      Thorsten


    Friday, January 15, 2016 5:06 PM
  • Hi Thorsten,

    When I open the project, the form is already garbled in the designer.  Changing the AutoScaleMode does not change the appearance of the form in the designer.  It probably changes the behavior of the form in the executable, but I do not have any trouble with the executable.  The executable runs perfectly on all of my platforms.  Maybe I'm missing something here, but it seems to me that the setting we need is an IDE option that I have not been able to find.  I can't find anything in the Windows Form Designer options on VS2013 and VS2015 that affects scaling - only Code Generation, grid snapping, ...  - nothing that would fix my problem.

    Bill 

    Friday, January 15, 2016 5:41 PM
  • Hi Thorsten,

    [...]  The executable runs perfectly on all of my platforms.  Maybe I'm missing something here, but it seems to me that the setting we need is an IDE option that I have not been able to find.  I can't find anything in the Windows Form Designer options on VS2013 and VS2015 that affects scaling - only Code Generation, grid snapping, ...  - nothing that would fix my problem.

    Bill 

    Hi,

    I dont think that there is an option like this... The WindowsForms Designer was made for 96 dpi I think, and since WindowsForms is afaik not under development for some years, I dont think they fix that problem soon... Maybe in a couple of years, when everybody realizes how good WindowsForms is (kind of the vinyl record of programming technologies)...

    Regards,

      Thorsten

    Friday, January 15, 2016 6:09 PM
  • The installed base of Windows Forms applications is huge.  I have at least 10 man-years of code that must be maintained.  Over the years, I have rewritten all my VB6 code in VB.NET.  I have migrated from Windows 2000 to XP, XP to 7, etc.  Microsoft has routinely abandoned support for their once highly-touted languages and operating systems: technology presses on.  Even so, we developers have always been able to move our develop platforms to the latest hardware so that we can track Microsoft's software and OS evolution without the impossible task of keeping old PCs working beyond their years.  If Microsoft does not provide decent development tools on high-res platforms, including their own hardware (e.g. Surface Pro 4), so that their developers can maintain old code on new hardware, that will be when I sell my Microsoft stock and buy Apple stock.  It is not an issue of whether Windows Forms is a vinyl record or a good technology for future development - this is an issue of whether Microsoft understands why they still exist when they have been totally unsuccessful in tablets and phones.  There is a market for what they do, but they may be getting ready to lose that market also.

    • Edited by wfaz2 Friday, January 15, 2016 6:37 PM
    Friday, January 15, 2016 6:34 PM
  • [...] It is not an issue of whether Windows Forms is a vinyl record or a good technology for future development - this is an issue of whether Microsoft understands why they still exist when they have been totally unsuccessful in tablets and phones.  There is a market for what they do, but they may be getting ready to lose that market also.

    Hi,

    of course you're right. I mentioned it only that way because I'm very disappointed about what MS did in the last years. I almost feel like they are dropping every concept that was good (just think of Windows8 and what we said when beta-testing and how they listened to us).

    BTW. I would use a WindowsTablet if... - if only we could download and install our software from where we want to (and maybe the appearance would be a little more "friendly looking" like color-gradients and inviting icons etc...)

    Regards,

      Thorsten



    Friday, January 15, 2016 7:08 PM
  • I like both the Surface 3 and Surface Pro 4, and I really like Windows 10.  I just want Microsoft to keep their promise that the Surface Pro 4 can replace my laptop ... that is not going to happen if I can't maintain and develop new software with Visual Studio on a high-resolution display.  Software development is why I use my laptop and why I bought a Surface.  If I want to get email and browse the Internet, I have Android and Apple for that.

    Regards, Bill

    P.S. If Microsoft doesn't get their act together soon, I will also have Android and Apple for software development.


    • Edited by wfaz2 Friday, January 15, 2016 8:03 PM adding a thought
    Friday, January 15, 2016 8:01 PM
  • Hi Bill,

    Currently I think I am not able to help you solve this issue. But I will invite some Microsoft senior engineer for further troubleshooting.

    Thanks for your understanding.

    Best Regards,

    Lake Xiao
    Monday, January 18, 2016 4:22 AM
    Moderator
  • Same here on the Surface Book (VS2015 Pro Update 1 on Windows 10).

    Any recommendations?

    Thanks in advance.

    Thursday, April 14, 2016 1:28 PM
  • Hi Alexander,

    I have not heard anything on this problem.  So far, my Surface Pro 4 remains useless for maintenance of WinForms programs.  I keep hearing that MS is no longer interested in WinForms, and all development is switched over to WPF.  Unfortunately, WPF does not do what needs to be done in the application areas where I work, and even if it did, I don't have the time to redevelop my applications.   

    Bill


    Bill

    Thursday, April 14, 2016 6:21 PM
  • Hi Bill,

    that's really annoying. I am able to start the WinForms program with the dpiAware setting set to False in the app.manifest so it looks OK at runtime but designing forms is a mess.

    I can't image that this is how it's meant to be by Microsoft. There are still quite a lot WinForms programs out there that must be maintained and evolved. And even if you have the time to redevelop your whole application in WPF - who's gonna pay for it?

    I'm going to get in touch with Microsoft directly and post the response here.

    Cheers, Alex

    Friday, April 15, 2016 7:28 AM
  • Hi Bill,

    today I started my Surface Book without opening it before but with already connected docking station and external displays. Now the Windows Forms designer works fine. I'm going to investigate this further...

    Cheers, Alex

    Friday, April 15, 2016 8:59 AM
  • Hi.

    I have exactly the same trouble.

    My vs2015 enviroinmente is running on Windows 10 Pro v. 1511(build SO 10586.218) on a well equiped Toshiba 13" notebook.

    It'isnt wisiwyg!!!!!

    Have you found a solution ?

    Thanks in advance.



    Tullio

    Monday, April 18, 2016 8:50 AM
  • Hi,yes, I just confirmed my suspicion. Today I booted my Surface Book again without opening it and the Windows Forms designer gets displayed fine.

    So if I first connect the docking station and then boot the Surface Book without opening it -> Windows Froms designer = OK

    Otherwise if I connect the docking station, open the Surface Book and then press the Start Button -> Windows Forms designer = NOT OK

    This solution works on the Surface Book/Surface. I Don't know how you can handle this one on your notebook. I hope it gives you an idea to solve your issue.

    Cheers,

    Alex

    Monday, April 18, 2016 9:01 AM
  • So, I decided to give it a try.  I attached an external monitor, and the forms in ONE of my old applications appears OK.  Closer inspection shows that the sizes of the form and controls are no longer matching the original: length and width has been scaled.  Font size shows the old value (MS San Serif, 12.75) but the font looks correct in the scaled up textbox.  This is weird.  So I opened another old application, and the form was still garbled as before.  Maybe I can find out what is happening, but I'm thinking it just is not worth the effort since my nice, light weight, and expensive Surface Pro 4 will have no advantages over my old laptop if I have to carry an external monitor and cables to make it usable.

    Thanks for the information: it gives me some hope that the problem is not with WinForms or Visual Studio, but may actually be in Windows or the Surface.  Microsoft does not give a damn about WinForms, but maybe they will fix Windows 10 or the Surface.


    Bill

    Monday, April 18, 2016 8:28 PM
  • I have quite a few programs both C++ winforms and C# winforms that were written under VS2010.

    I had all sorts of problems when  I upgraded to newer version of VS.

    Luckily I don't have to change those programs much so it hasn't been too big a problem.

    MS should never have ditched winforms.


    n.Wright

    Monday, April 18, 2016 8:44 PM
  • Nigel,

    Did you switch to a new, high resolution, PC or did you just install the newer Visual Studio?  A while back I tried VS 2010 on the Surface Pro 4, and I think it exhibited the same problems as VS 2105.  Every one of these tests is a royal pain in the ass and takes me away from doing something productive: just don't have time to test every PC, laptop, and tablet on every version of Visual Studio, but it seemed to me that the problem was not linked to the version of Visual Studio: it seemed to be linked to the display resolution. For example, I have no problem running VS 2015 on my 1400 x 900 laptop running Windows 10, but VS 2015 totally craps out on the Surface 3 and Surface Pro 4 which have much higher resolution.  Also, VS 2015 seems to work on the Surfaces if I set the screen magnification to 100x, but everything is so tiny I cannot read it, much less click on it.


    Bill

    Monday, April 18, 2016 9:27 PM
  • Seems that

            Me.AutoScaleDimensions = New System.Drawing.SizeF(96!, 96!)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi

    fixes this, I successfully tried in one form. But I had to set this in the designer under 96dpi, otherwise the designer changes lots of sizes.

    Or change it manually by text editing the *.designer.vb

    Is much work if we have to change *every* form, but it has to be done only once.

    Is there an easier solution, maybe with form inherit ?

    Reagds Marcus

    • Proposed as answer by E. Semog Thursday, October 13, 2016 8:16 PM
    Friday, May 20, 2016 4:14 PM
  • Hi,yes, I just confirmed my suspicion. Today I booted my Surface Book again without opening it and the Windows Forms designer gets displayed fine.

    So if I first connect the docking station and then boot the Surface Book without opening it -> Windows Froms designer = OK

    Otherwise if I connect the docking station, open the Surface Book and then press the Start Button -> Windows Forms designer = NOT OK

    This solution works on the Surface Book/Surface. I Don't know how you can handle this one on your notebook. I hope it gives you an idea to solve your issue.

    Cheers,

    Alex

    Hi,

    Thank you very much for this. You're right. It works fine.

    Regards Sascha


    Sascha Landowski | Haushaltsbuch Cash Matrix | Nutzen Sie ein Haushaltsbuch, um Ihre Finanzen zu optimieren!

    Sunday, June 12, 2016 4:42 PM
  • Changing scale does not work for me.

    So Surface pro 4 has so many issues.

    1) Windows 10 anniversary version puts a drop down screen which no code will remove

    2) Shut down API's don't work as nothing can wake it up.

    3) VS scaling is all over the show.

    So Microsoft have developed a new iPad replacement e,g. email and browser! any other more complex function I suggest use Linux and some none .net function. Over my years of working on Microsoft products it shows the company has no idea. Please if you can talk to the CEO tell him its all not working!

    No bank or real application could use a surface pro for any safe action. No need for Facebook or Twitter maybe Microsoft should read Face book on its metro tiles and read the complaints!



    David@rathbone.com

    Tuesday, September 20, 2016 4:01 PM
  • I am using my expensive MS Surface Pro 4 for showing PowerPoint presentations at trade shows.  It is totally useless for any real work.  I ended up buying a nice Lenovo ThinkPad with a 1920x1080 display for software development.  There are so many problems with the Surface Pro 4 ... I just don't have time to keep trying to make it work.

    Bill

    Tuesday, September 20, 2016 5:15 PM
  • Yeah, very sad. Instead of getting better it's getting worse. My Surface Book worked great until I replaced my dual-monitor-system by a 34" ultra wide screen. Since then it's a challenge every day. I have to unplug my Surface Dock, switch the monitor port and so on. Suddenly it works - and that's quite the same routine every single day.

    Very disappointing. Hardware for about 3k bucks which doesn't work properly.

    Alex




    Wednesday, September 21, 2016 6:25 AM
  • I am having the same issue on a new Dell laptop with hi-res display (Nvidia GEFORCE GTX); running Windows 10 pro.  So it would appear that the problem is not necessarily specific to Surface Pro, but to hi-res displays in general.

    Bob

    Sunday, November 20, 2016 5:24 PM
  • I have the same issue on  Dell XPS with visual studio 2015 and 2010 pro.  The dell requires 200% scaling and the IDE obviously does not work with 200% scaling and Windows forms created on a system that starts at 100% scaling.

    Any resolution?

    Friday, March 10, 2017 4:38 AM
  • Have you tried setting the <dpiAware> flag in the app.manifest of your application. Here are some useful links about this topic:

    https://blogs.msdn.microsoft.com/chuckw/2013/09/10/manifest-madness/

    http://www.telerik.com/blogs/winforms-scaling-at-large-dpi-settings-is-it-even-possible-

    Otherwise you could also upload a sample of your application and I'm going to try it out on my system.

    Kind regards,

    Alexander

    Friday, March 10, 2017 7:20 AM
  • I'm also having this issue. Decided to install VS2017 on SP4 in order to make development faster and easier. When I opened the project everything was squished and I had to walk away from it in search of a solution...
    Sunday, March 19, 2017 6:32 PM
  • I tried this solution for VS2015, running on Dell XPS 15:

    https://code4ward.net/2016/11/29/visual-studio-winforms-designer-on-highdpi/

    Now Visual Studio is working WYSIWYG mode during design time!

    Saturday, May 20, 2017 3:09 PM
  • Solution

    https://code4ward.net/2016/11/29/visual-studio-winforms-designer-on-highdpi/

    Thursday, July 20, 2017 4:12 PM
  • Thank you for posting this link. That solved it for me. Now I don't have to go out and buy another machine. REALLY appreciate it.
    Sunday, August 20, 2017 11:23 AM
  • You are a legend. This has been bugging me for so long and I couldn't find anyway to fix it but that registry hack worked a treat.
    Friday, March 02, 2018 1:54 PM