Why are my dialog boxes too small on some (but not all) Windows7 computers?

ε祈祈猫儿з 提交于 2019-12-01 16:43:02

Although both screen DPI and Themes can change the size of controls, that is not the problem here because in your screen shots the window chrome and non-text control sizes are unchanged. The problem is you are not taking custom font sizes into account.

If you wanted to move controls around to fix them into a fixed form size you would have to perform calculations using the Control.AutoScaleDimensions property of your controls. That is a lot of work, don't do that.

Instead, lay out your controls using absolute coordinates and enlarge your form to contain the results. Set your forms' AutoScaleMode = AutoScaleMode.Font.

I had the same issue when a Win 7 user adjusted the default font size in "Control Panel\All Control Panel Items\Display"

When you have forms set to "Fixed Dialog" set the following properties on your form: .AutoScaleMode=Font .AutoSize=True .AutoSizeMode=GrowOnly so windows can resize your form based on the sizes of the child elements.

Display size, resolution, DPI, large fonts, small fonts are some possible causes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!