DPI not scaling properly

风格不统一 提交于 2020-01-14 13:29:56

问题


I created a custom UserControl that functions much like a numbericUpDown but with various enhancements. For example, it can display fractions. However, this control does not scale as well as some of my other controls on my form, forcing my UI to look awkward.

I played around with the AutoScaleMode of both the control and it's parent control. Nothing seems to work, though setting the AutoScaleMode to None seems to have less impact than the other settings. I also tried manually to lessen the size of the control in relation to the dropdown next to it. It didn't work. I'm pretty much stuck and I don't know how to counter this.

Any suggestions?

I am enabling DPI awareness for Win7 and higher.


回答1:


I solved this problem. For those interested, My numericUpDown control was inside another usercontrol which I have made. This control's AutoScaleMode was not set to DPI and therefore, was not scaling properly. The answer is to have all controls use the same AutoScaleMode.



来源:https://stackoverflow.com/questions/4073296/dpi-not-scaling-properly

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