如何使窗体的大小响应每种类型的屏幕分辨率? [英] How to make size of window form responsive for every type of screen resolution?

查看:65
本文介绍了如何使窗体的大小响应每种类型的屏幕分辨率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I want to make size of Window  form responsive for every type of screen resolution. 
I am developing this app on the screen size of 1366 * 768.
But its not working as expected for other screen ressolution like 1420 * 1080

I dont want to use WPF application.

Thanks in advance.





< b>我尝试了什么:





What I have tried:

I have alredy used TableLayOut Panel,FlowlayOut Panel, Dock and Anchor.
But i am not getting expected result.

Can i write my custom code to make window form responsive? If yes, then any tiny help will be more valuable sir.

I dont want to use WPF application.

Thanks in advance.

推荐答案

我们不能告诉你 - 不是因为它是一个秘密,而是因为我们不知道你的UI是如何编码的,或者它应该如何看。更不用说,它在不同的分辨率下看起来像是没有按预期工作。所有你能做的就是看两个显示器,试着找出错误的尺寸或错误的形状,并集中精力找出原因。


通常情况下,当你降低分辨率时会出现这些问题,但这不是唯一的因素:不同的PC可以设置为使用不同的缩放因子,以允许文本在小屏幕上比在较大的屏幕上更大。可能是这让你搞砸了。



很多时候,错误是UI设计得很糟糕:控件太多,文字太多,太靠近了。



但是我们无法为你修复它。
We can't tell you - not because it's a secret, but because we have no idea how your UI is coded, or how it is supposed to look. Much less, what it looks like at different resolutions that means it's "not working as expected". All you can do is look at the two displays and try to work out what is the wrong size, or wrong shape, and concentrate of finding out why.

Normally, these problems come when you reduce the resolution, but that's not the only factor: different PC's can be set to work with different zoom factors to allow text to be bigger on a small screen than it is on a bigger one for example. It may be this that's messing you up.

And pretty often, the fault is that the UI is badly designed: too many controls, too much text, too close together.

But there really isn't anything we can do to fix it for you.


我找到了最好的方法解决此类问题的方法是确保表单上的每个控件都被锚定或停靠 - 如果需要,可以在面板中将较少的控件放在一起,然后将这些控件锚定到面板,并将面板锚定或停靠到表单。将表单分成更少控件的组使得它更容易,但仍然需要一些摆弄。您只需手动调整表单大小,就可以合理地检查它的工作方式,并查看控件的反应方式。
I have found the best way to solve this type of problem is to make sure every control on the form is anchored or docked - if necessary put group fewer controls together in a panel, then anchor those controls to the panel, and anchor or dock the panel to the form. Breaking the form up into groups of fewer controls makes it easier, but still some fiddling is needed. You can check reasonably well how it will work by just resizing the form manually, and see how the controls all react.


这篇关于如何使窗体的大小响应每种类型的屏幕分辨率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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