0

Does anyone know why the location of some of my controls is different between designer and run mode? It's driving me nuts. In designer they are all in the right location, anchored as should be, but when I run the application, the form is somewhat resized but the controls don't move accordingly. The ones on the outer right are all somewhat hidden, and resizing the form in run mode does not improve this as they are anchored. Thanks

Designer view

Run view

Sinatr
  • 20,892
  • 15
  • 90
  • 319
  • Location looks the same. It's size of the form what is different. You can disable form resizing (good for dialogs) or rather make a proper adative to window size *layout* (look for `FlowLayoutPanel`/`TableLayoutPanel`). In your case `Progress` part can take *rest* of width, so for a bit-smaller form (like you have now) it will be a bit smaller. Use minimum width to restrict from making form too small. – Sinatr Sep 02 '20 at 07:18
  • 1
    Have you noticed that your running Form is somewhat *blurry*? Apply this, to make your app DpiAware: [How to configure an app to run correctly on a machine with a high DPI setting](https://stackoverflow.com/a/13228495/7444103) then read this: [High DPI support in Windows Forms](https://learn.microsoft.com/en-us/dotnet/framework/winforms/high-dpi-support-in-windows-forms) and this: [High DPI Desktop Application Development on Windows](https://learn.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows) to start improving it. – Jimi Sep 02 '20 at 07:45
  • 1
    You should use .Net Framework 4.7.2+ to have a better control on DPI awareness features provided by Windows 10 (related to per-monitor DPI awareness). -- Test the difference when you set a Form's `AutoScaleMode = Dpi` and `Font`. – Jimi Sep 02 '20 at 07:48
  • Thanks all. Tried Jimi's solution and it worked like a charm. I'm stuck at Framework 4.5 due to company restrictions, but setting the app to be dpiaware did the trick. – Kristof Bayens Sep 02 '20 at 08:49
  • @KristofBayens why not add it as an answer and mark your question as answered - it will help future people to see that it was resolved and how you did it and you might get an upvote or 2 – Dave Sep 02 '20 at 10:34

1 Answers1

0

Configuring the application to use the correct dpi setting was the solution. Thanks Jimi! :)