如何完成从C#中的Windows窗体标题栏中删除“退出”按钮 [英] How to Complete remove the Exit button from the title bar in windows form in C#

查看:85
本文介绍了如何完成从C#中的Windows窗体标题栏中删除“退出”按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何完成从C语言窗口中的标题栏中删除退出按钮#







任何建议

How to Complete remove the Exit button from the title bar in windows form in C#



Any Suggestion

推荐答案

您可以参考以下链接 -

禁用表单上的关闭按钮 [ ^ ]



C#关闭按钮禁用示例 [ ^ ]
You can refer below links-
"Disabling Close Button on Forms[^]

C# Close Button Disable Example[^]


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



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



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

If you need a border you can set:

ControlBox = "false";
Text = "";



如果你想禁用关闭按钮,那么试试这个:

禁用应用程序关闭按钮 [ ^ ]





      --Amit


And if you want to disable the close button then try this:
Disable An Applications Close Button[^]


     --Amit


http: //msdn.microsoft.com/en-us/library/system.windows.forms.form.controlbox.aspx [ ^ ]



http://msdn.microsoft.com/en-us/library/system.windows.forms.form.controlbox.aspx[^]

public void CreateMyBorderlessWindow()
 {
    this.FormBorderStyle = FormBorderStyle.None;
    this.MaximizeBox = false;
    this.MinimizeBox = false;
    this.StartPosition = FormStartPosition.CenterScreen;
    // Remove the control box so the form will only display client area.
    this.ControlBox = false;
 }


这篇关于如何完成从C#中的Windows窗体标题栏中删除“退出”按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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