根据屏幕分辨率或显示器大小设置表单大小 [英] Set Form Size according to Screen Resolution or Monitor Size

查看:124
本文介绍了根据屏幕分辨率或显示器大小设置表单大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





根据屏幕分辨率或显示器尺寸设置表格大小

ho做以上事情..

hi

Set Form Size according to Screen Resolution or Monitor Size
ho to do above thing..

推荐答案

坦率地说,我不会。

除非你的表单与Visual Studio一样工作,文本的中央工作区和当你自动调整大小时,它通常不会很好地工作。

问题是,使用WinForms,通过使用Dock和Anchor属性来实现它是相当容易的。各种控件,它是改变大小的控件 - 它们上面的文本没有。所以你倾向于最终得到一个bug按钮,中间有一个小写,或一个小按钮,而不再有足够的文字空间。



使用WPF可以更好地工作,但即使这样,自动放大的东西也不一定会带来好看的结果。



例如,我使用两个显示器运行:一个风景,另一个风景。如果你调整你的表格大小以匹配我的屏幕分辨率,你做哪个显示器?任何一个人本身不太可能与你的应用程序有类似的宽高比,而且这两者都会非常扭曲!



你通常更好地选择良好的大小并坚持下去。
Frankly, I wouldn't.
Unless your form works in the same way as Visual Studio, with a central "work area" for text, and tools etc. round the edges, it generally doesn't work too well when you automatically resize things.
The problem is that with WinForms it's fairly easy to do it by playing with the Dock and Anchor properties of the various controls, it is the controls that change size - the text on them does not. So you tend to end up with a bug button, with tiny writing in the middle, or a tiny button, than no longer has enough room for the text.

Things work better with WPF, but even then, automatically enlarging things doesn't necessarily give a good looking result.

For example, I run with two monitors: one landscape, and the other portrait. if you adjust your form size to match my screen resolution, which monitor do you do it for? Either one on its own is unlikely to be a similar aspect ratio to your application, and the pair of them would be very distorted!

You are normally better picking a "good" size and sticking to it.


在大多数情况下,我认为最好将您的应用程序中当前大小的Forms保留在Windows操作系统中,以及用户的选择在运行时。



为什么不让用户点击'最大化按钮,如果他们想要一个全屏窗口?



当然,也有例外,程序员选择创建全屏模式应用程序;这通常在某些类型的(不是Windows窗体)游戏,自助服务终端模式应用程序等中完成。



而且,正如OriginalGriff雄辩地指出的那样,如果你有多个显示器,全屏意味着什么。



如果您想要更多反馈,我建议您详细描述您的应用程序的目的,以及您正在考虑使用整个屏幕的原因。
In most cases, I think it's a good idea to leave the current sizes of Forms in your Application "up to" Windows OS, and the user's choices at run-time.

Why not let the user click the 'Maximize button if they want a full-screen window ?

Of course, there are exceptions, where the programmer chooses to create a full-screen mode application; this is often done in certain types of (not Windows Forms) games, in kiosk-mode applications, etc.

And, as OriginalGriff eloquently points out, if you have multiple monitors, what does "full-screen" mean.

If you want more feedback, then I suggest you describe, in detail, the purpose of your application, and the reasons why you are now considering using the entire screen.


这篇关于根据屏幕分辨率或显示器大小设置表单大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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