如何制作全屏模式,同时调整按钮,标签,文本框的大小...... [英] How to make a full screen mode that also resizes buttons, label, textbox...

查看:141
本文介绍了如何制作全屏模式,同时调整按钮,标签,文本框的大小......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何在C#中制作全屏模式,同时调整按钮,标签,文本框的大小......当我使用时:

WindowState = FormWindowState .Maximized;我只得到全屏的表格而不是组件。

解决方案

你可以使用 Dock ,或者为了更精确的控制使用锚点属性。通过将 Anchor 设置为Left,Right,Top,Bottom,控件将随窗口缩放。通过将锚点设置为右,控件将以右边框移动。通过将锚点设置为顶部和底部,控件将垂直缩放,但具有固定宽度。

查看一些示例..

使用锚定和停靠属性 [ ^ ]

Control.Anchor Property [ ^ ]

Form Anchor [ ^ ]

Hi,
How can I make a full screen mode in C# that also resizes buttons, label, textbox.... When I use:
WindowState = FormWindowState.Maximized; I only get the form in full screen not the components.

解决方案

You can use Dock, or for more precise control use the Anchor property. By setting Anchor to Left, Right, Top, Bottom the control will scale with the window. By setting Anchor to Right the control will move with the right border. By setting Anchor to Top and Bottom the control will scale vertically, but have a fixed width.
See some example..
Working with Anchoring and Docking Properties[^]
Control.Anchor Property [^]
Form Anchor[^]


这篇关于如何制作全屏模式,同时调整按钮,标签,文本框的大小......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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