禁用最小化和放大器;最大限度地提高WinForm的? [英] Disabling Minimize & Maximize On WinForm?
问题描述
的WinForms已经在右上角的最小化,最大化,并关闭表单的三盒。我希望能够做的是删除最小化和最大化,同时保持接近。
WinForms have those three boxes in the upper right hand corner that minimize, maximize, and close the form. What I want to be able to do is to remove the minimize and maximize, while keeping the close.
我做什么也密切最小化的形式,而不是关闭它。
I also what to make the close minimize the form instead of closing it.
如何才能做到这一点?
推荐答案
的表单
有两个属性名为 MinimizeBox
和 MaximizeBox
,他们都设置为假
。
The Form
has two properties called MinimizeBox
and MaximizeBox
, set both of them to false
.
要停止的形式结束,处理的FormClosing
事件,并设置 e.Cancel = TRUE;
在那里,在那之后,设置的WindowState = FormWindowState.Minimized;
,以最小化的形式
To stop the form closing, handle the FormClosing
event, and set e.Cancel = true;
in there and after that, set WindowState = FormWindowState.Minimized;
, to minimize the form.
这篇关于禁用最小化和放大器;最大限度地提高WinForm的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!