-1

I am developing my app on two different PCs, both having Windows 10 and Visual Studio 2015 installed using the same installers. When I open some of my WinForms in lab PC, the controls included in the WinForms appear all congested together (and even overlapping each other) making it impossible for me to modify the visuals. This happens only in "design mode". When i run the app, all forms appear correctly. Kindly see the difference in attached pic enter image description here

This happens only for a few of the forms, not all. But despite comparing each and every form property (including "AutoScaleMode" which is set to "Font" for each form), i couldn't locate the cause. The other PC is showing all the forms 100% correctly in design mode.

What could be the possible reason/solution?

EDIT: Solution discussed here also has no effect in my case, whereas other posters said that their issue was resolved by changing the DPI-awareness of their PC.

Dia Sheikh
  • 190
  • 2
  • 16
  • 2
    Different dpi and then [form autoscaling](https://msdn.microsoft.com/en-us/library/system.windows.forms.containercontrol.autoscalemode(v=vs.110).aspx) does that. – Sinatr Sep 21 '17 at 08:57
  • But how come same dpi has different effect on different forms on same machine? – Dia Sheikh Sep 22 '17 at 03:49
  • @Sinatr, kindly see my updated post. This is happening only in Design mode which makes it impossible for me to modify effected forms' layouts. When run, all forms appear entirely correctly on both PCs. – Dia Sheikh Sep 22 '17 at 04:45

1 Answers1

0

This happens when your application is not responsive to different sizes of the display! you need to set the Anchor and Dock properties in winform.

Make it responsive but the best solution is to develop the application on WPF.

Thanks

  • I personally want to work with WPF but never did due to WPF deprecation. As for this specific app, I have developed 90% of the app... quite huge one... can't start from scratch. My concern is again the same WHY only a few of the forms are effected on just one machine provided all the parameters (including the screen sizes) are the same. – Dia Sheikh Sep 22 '17 at 04:02
  • I see WPF technology in UWP and Xamarin.Forms and that WinForms got no new features or meaningful fixes in the last 14 years, where is it deprecated? Anyway, you probably set a different AutoSizeMode on this form. – Ray Feb 07 '18 at 05:31
  • Thanks @RayKoopa for your suggestion. But solution came out to be totally irrelevant to Visual Studio. My monitor's resolution on other PC was quite high (3840 x 2160 or something like that) and the installed/default display driver had disabled changing the resolution. I downloaded and installed AMD's driver as a last try. When i installed it, the display options enabled the resolution changing drop down. I set it to 1920 x 1080. Logged off. Logged back in and everything from other applications' display to Visual Studio designer's display was normal. Pretty bad of VS designer programmers... – Dia Sheikh Feb 12 '18 at 04:18
  • And i wonder what these down voters are playing at? A programmer is in some real trouble due to a specific problem and instead of trying to help, all they have to do is click a single down arrow and go away :( Shame on such thinking. It took me many months, at least 4+, to get to the real solution. Search the MS and VS sites, they are full of this complaint, but ppl here at SO keep on downvoting your genuine problem. Damn! – Dia Sheikh Feb 12 '18 at 04:27
  • Changing the resolution pretty much changed your DPI settings back to default DPI. Windows typically switches to HighDPI modes if you set high resolutions. – Ray Feb 12 '18 at 08:37