Often I will create a winforms app and everything looks great when I run it. Then I go to a user’s computer and I see that labels are crunched, fonts are bigger and causing text to be cut off etc. What is going on? How can I prevent this?
I especially see this on newer windows OS’, i.e. Windows 7 etc. How can I make the form look the same (or at least good) for all users, on multiple windows OS versions?
If the UI is getting messed up because the fonts on the system are bigger or the DPI of the system is different from what you expected there are a couple of things you should do:
Graphics.MeasureString()to calculate the size of strings instead of assuming a fontsizeEDIT
Of course it is also possible to distribute fonts (if legal) to make sure the correct/expected fonts are available but you will still need to anticipate various DPI settings.