Mohsin Kale Mohsin Kale - 1 month ago 19
C# Question

C# Winform Control Dimensions Strange Out Of Editor?

I've run into this weird sizing issue for my windows form application when run. Now in the designer the program looks like This1 (can't upload more then 2 links so look in comments). However when I run it from visual studio it looks like This (notice how all the controls are closer together, the picture box is automatically wider and taller & the picturebox in tileset subform is larger).

When built and run outside of Visual Studio from the

folder, it looks perfectly fine (as it would in Visual Studio like This). However I recently changed the build folder to one with a shorter path and when I now run from there the entire form looks much larger and the picturebox is again scaled in this2 (can't upload more then 2 links so look in comments).

Answer Source

take a look at this similar question.

  • Did you try to set the dpi awareness in the manifest as in the question above?
  • Also be sure, you run both (visual studio) and the .exe from bin/debug as the same user (ex. run as Administrator).

And if it's not to late, consider a change to wpf, it responds much better to the different screens and different resolutions - at least in my opinion and experience.