C# 带有调整框架大小且没有标题栏的 Windows 窗体?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/93716/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 11:36:33  来源:igfitidea点击:

Windows Form with Resizing Frame and no Title Bar?

提问by Brian Gillespie

How can I hide the title bar from a Windows Form but still have a Resizing Frame?

如何从 Windows 窗体隐藏标题栏,但仍有调整大小框架?

采纳答案by Brian Gillespie

Setting FormBorderStyle = None will remove the title bar (at both design and run time) - and also remove your ability to resize the form.

设置 FormBorderStyle = None 将删除标题栏(在设计和运行时) - 并且还删除您调整表单大小的能力。

If you need a border you can set:

如果您需要边框,您可以设置:

ControlBox = false
Text = ""

回答by Nikki9696

Set the ControlBox property of the form to False, and the Text property to empty string. The form will open with no perceivable (to the user) title bar, but they will be able to resize the form.

将窗体的 ControlBox 属性设置为 False,并将 Text 属性设置为空字符串。表单打开时没有可感知的(用户)标题栏,但他们将能够调整表单的大小。