高DPI问题 [英] high DPI problems

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

问题描述

我有一个与我们在高DPI设置.NET Windows应用程序的显示的问题。

所有表格都设置为AutoScaleMode = DPI,但是这并没有解决所有的问题。

标签基本上结束了扩大规模,以应对woth字体为大,但其他控件的位置没有改变,我们最终标贴遮住其他控件或海誓山盟。

,屏幕应该是这样的: http://www.manageinvest.com/good.jpg ..和高DPI它结束了看起来像这样: bad.jpg (这是我的第一篇文章,所以我只允许一个连接)

有什么建议?

在此先感谢,

克里斯蒂安

解决方案

在理论上,字体和DPI缩放在的WinForms是自动的。在实践中...没有这么多。

我发现它对付不是水平垂直缩放更好的,但即使如此,这是远远不够完善。

在我的经验,当你做两件事之一比例是唯一可靠

  1. 不要使用设计的。这是很痛苦的,但它确实给你在你的布局控制的需要量。

  2. 使用内置的布局控件 - 具体而言, FlowLayoutPanel的的TableLayoutPanel 。这些人是你最好的朋友;我很少这样做的什么的Winforms中没有他们了。

在你的情况,我可能会去与#2。根据屏幕捕捉,我认为这将是很容易满足您的布局成的组合的TableLayoutPanel FlowLayoutPanel的容器 - 甚至可能只是一个的TableLayoutPanel

I have a problem with the display of our .NET Windows application under high dpi settings.

All forms are set to AutoScaleMode = DPI, but this does not solve all the problems.

Basically labels end up expanding in size to cope woth the font being bigger, but the location of other controls does not change and we end up with lables obscuring other controls or eachother.

The screen should look like this: http://www.manageinvest.com/good.jpg ..and on high DPI it ends up looking like this: bad.jpg (this is my first post so i am only allowed one link)

Any suggestions?

Thanks in advance,

Kristian

解决方案

In theory, font and DPI scaling in Winforms are automatic. In practice... not so much.

I've noticed that it copes better with vertical scaling than horizontal, but even then it's far from perfect.

In my experience, scaling is only reliable when you do one of two things:

  1. Don't use the designer at all. This is quite painful, but it does give you the requisite amount of control over your layout.

  2. Use the built-in layout controls - specifically, the FlowLayoutPanel and TableLayoutPanel. These guys are your best friends; I rarely do anything in Winforms without them anymore.

In your case, I'd probably go with #2. Based on the screen capture, I think it would be quite easy to fit your layout into a combination of TableLayoutPanel and FlowLayoutPanel containers - possibly even just one TableLayoutPanel.

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

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