如何在C#中禁用或消失Windows窗体标题中的退出按钮 [英] how to disable or disappear the exit button in the title of windows form in c#

查看:273
本文介绍了如何在C#中禁用或消失Windows窗体标题中的退出按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c#

推荐答案

如果将窗体的ControlBox属性设置为false,则所有三个按钮(最小化,最大化和关闭)将会消失.

其他方法是在Allan Chong提供的链接中.

第三种可能的方法是处理Closing事件并设置
If you set ControlBox property of the form to false, all three buttons (minimize, maximise and close) will go off.

Other way would be at the link Allan Chong provided.

And third possible way is to handle Closing event and set
e.Cancel = true;


第三种方法可能是最好的,因为您可以在取消关闭事件和/或根据需要进行日志记录之前警告用户,然后决定是否关闭它.

-Milind


This third way might be the best as you can warn the user before cancelling the close event and/or do logging as required and then make decision whether to let it close or not.

-Milind


查看此处: )


这篇关于如何在C#中禁用或消失Windows窗体标题中的退出按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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