DPI无法正确缩放 [英] DPI not scaling properly

查看:126
本文介绍了DPI无法正确缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个自定义UserControl,其功能类似于numbericUpDown,但具有各种增强功能。例如,它可以显示分数。但是,此控件无法像我窗体上的其他控件那样缩放,迫使我的UI看起来很尴尬。

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.

我在两个控件及其父控件。似乎没有任何效果,尽管将AutoScaleMode设置为None似乎没有其他设置那么大。我还尝试手动减小控件旁边的下拉列表的大小。没用我非常困惑,我不知道该如何应对。

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.

有什么建议吗?

我正在为Win7启用DPI感知甚至更高。

I am enabling DPI awareness for Win7 and higher.

推荐答案

我解决了这个问题。对于那些感兴趣的人,我的numericUpDown控件位于我创建的另一个用户控件内。此控件的AutoScaleMode未设置为DPI,因此无法正确缩放。答案是让所有控件都使用相同的AutoScaleMode。

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.

这篇关于DPI无法正确缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆