DPI 无法正确缩放
我创建了一个自定义 UserControl,其功能与 numbericUpDown 非常相似,但具有各种增强功能。例如,它可以显示分数。但是,此控件的缩放比例不如窗体上的其他一些控件,这迫使我的 UI 看起来很尴尬。
我尝试了控件及其父控件的 AutoScaleMode。尽管将 AutoScaleMode 设置为 None 似乎比其他设置的影响较小,但似乎没有任何效果。我还尝试手动减小控件相对于其旁边的下拉列表的大小。它不起作用。我几乎陷入困境,我不知道如何应对。
有什么建议吗?
我正在为 Win7 及更高版本启用 DPI 感知。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我解决了这个问题。对于那些感兴趣的人,我的 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.