如何从C#的“窗口"窗体中删除(而不是禁用)关闭按钮(X)? [英] How to remove (not disable) the close button (X) from Window form in C# ?

查看:103
本文介绍了如何从C#的“窗口"窗体中删除(而不是禁用)关闭按钮(X)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从C#的窗口"窗体中删除(而不是禁用)关闭按钮(X)?
请帮忙...
谢谢
dinesh

How to remove (not disable) the close button (X) from Window form in C# ?
Please help...
Thanks
dinesh

推荐答案

我个人知道可以做到这一点的3种方法,但这取决于您对最小化"和最大化"按钮的需求.
第一个是在属性菜单中将边框样式设置为"none",但是这将完全删除所有按钮以及窗口顶部的"windows header whaty".

第二种方法是将controlBox属性设置为false.这将删除所有按钮,但您将保留标题.

我知道的最后一个是使用用户控件来制作自己的表单,但是为此我必须说,您必须用谷歌搜索结果,因为我对用户控件的了解不多,但是前两个应该可以很好地完成工作,如果你不太挑剔:)

希望有帮助-Jackie
I personaly know 3 ways this can be done, but it depends alot of you needs of the minimize and maxisize buttons.

the first one is to set the border style to "none" in the properties menu, however this will completely remove all buttons and the "windows header thingy" in the top on the window.

the second method is to set the controlBox property to false. this will remove all buttons but you''ll keep the header.

the last one i know is to make your own form with user-controls, but for that i must say you must google you to the result since i dont know much about user-controls, but the first 2 should do the job just fine if you aint too picky :)

Hope this help - Jackie


在窗体上将make控件框加载为false

On form Load make control box to false

this.ControlBox = false;


使用以下属性

use the below property

FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;


这篇关于如何从C#的“窗口"窗体中删除(而不是禁用)关闭按钮(X)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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