在设计器中最大化winform [英] Maximize winform in the designer

查看:56
本文介绍了在设计器中最大化winform的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想知道如何在设计器中调整Winform的大小,以便为您提供最大化窗体时的实际大小,以便我确切地知道将窗体组件放在何处.

知道怎么做吗?

Hi everyone,

I want to know how can I resize a winform in the designer so that it gives me the real size as when you maximize the form so that I know exactly where to put my form components.

Any idea how to do that?

推荐答案

您打算如何获得最大化形式的实际尺寸"?不同的用户可能会在其显示器上使用不同的分辨率,因此每个系统上的最大化形式将有所不同.
我建议您根据要在表单上拥有的控件来决定表单的最小尺寸,并据此设置大小.然后结合使用停靠和锚定,确定用户何时将表单变大的规则.
How do you intend to get the "real size" for a maximized form? Different users will potentially be using different resolutions on their monitors, so a maximized form on each of their systems will differ.
I would suggest that you decide on a minimum size of your form based on the controls you want to have on the form and set up the sizing and such based on that. Then using a combination of docking and anchoring decide on rules for when the form is made larger by the user.


不.最好的办法是在设计表单时注意最小和/或最大尺寸,并在调整表单大小时以适合您意图的方式使用停靠和/或锚定.

设计表单后,您可以编译运行该应用程序,并查看调整大小后会发生什么.

当然,您也完全可以根本不允许调整表单的大小,但这对您来说可能不是一个可行的选择.只有您可以回答这个问题.
Nope. Your best recourse is to design your form with a minimum and/or maximum size in mind, and use docking and/or anchors in a manner appropriate to your intentions when the form is resized.

Once the form is designed, you can compile run the app and see what happens when you resize.

Of course, you can also simply not allow the form to be resized at all, but that may not be a viable option for you. Only you can answer that question.


除了Marcus和John的回答之外:您最好打赌要学习原则上高度容忍窗口大小的表单布局,至少在最大尺寸.至于最小的尺寸,最好使用Designer查找最佳的尺寸.关键在于使用许多嵌套面板和其他类似控件(例如TabControl),并使用带有填充的停靠.

请查看我过去关于尺寸/分辨率允许的设计和相关设计问题的答案:
当屏幕分辨率改变时,Zom Out发生故障 [ ^ ],
GUI外观-C#.Net [如何停靠按钮,以便它可以使用以下格式进行调整 [
In addition to the answers by Marcus and John: you best bet it to learn form layout highly tolerant to the size of the window in principle, at least on maximum sizes. As to the minimal size, you better find out the best using the Designer. The key is in using many nested panels and other similar controls (like TabControl) and use docking with padding.

Please see my past answers on the size/resolution-tolerant design and related design issues:
Zom Out malfunctions when Screen resolution changes[^],
GUI Apperance - C#.Net[^];

rudimentary code sample here:
how to dock button so that it can adjust with the form[^].

—SA


这篇关于在设计器中最大化winform的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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