0

I've created a simple windows form in the designer and not modified any of the design code. Yet, when I launch it, some controls are bigger than they should be and the window is the wrong size. I've tried following this answer but it makes no difference.

GIF of Issue

Could you please advise on how to go about fixing this?

ScottishTapWater
  • 3,656
  • 4
  • 38
  • 81
  • Which controls exactly are bigger than expected and what size does the window have (and what size do you expect)? I can't see anything wrong in the GIF. What OS are you running on and do you have scaled screen settings? – Nico Schertler Aug 19 '18 at 16:54
  • If you look at the GIF the listbox is too big and hids the status bar (that's the most obvious one, the rest are all too big too I think). I'm running Windows 10 and I've tried both with and without the "fix blurry text" options. My "make everything bigger" setting is 250% but surely windows should handle all this? I've never had these problems before. – ScottishTapWater Aug 19 '18 at 16:58
  • Is the list box really too big (i.e., what size is it set to have)? The designer gives you only a preview. Results at runtime may vary. So, the question is: Which of your settings does the runtime apparently violate? Have you used proper layout containers and mechanisms (e.g., the `Dock` property for the status bar)? – Nico Schertler Aug 19 '18 at 17:08
  • use maximum size and minimum size properties to fix components size – user8190410 Aug 19 '18 at 17:10
  • As you have scaling set to 250% you may need to opt in to the new Windows 10 [High DPI Scaling](https://learn.microsoft.com/en-us/dotnet/framework/winforms/high-dpi-support-in-windows-forms) – Handbag Crab Aug 19 '18 at 17:43
  • 2
    Your application is not DPI Aware, your Form scales to Font and is subject to virtualization. See [these notes I've written](https://stackoverflow.com/questions/50239138/dpi-awareness-unaware-in-one-release-system-aware-in-the-other?answertab=active#tab-top) and this: [How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)](https://stackoverflow.com/questions/13228185/how-to-configure-an-app-to-run-correctly-on-a-machine-with-a-high-dpi-setting-e?answertab=active#tab-top). – Jimi Aug 19 '18 at 17:58

0 Answers0