禁用最小化和放大器;最大限度地提高WinForm的? [英] Disabling Minimize & Maximize On WinForm?

查看:116
本文介绍了禁用最小化和放大器;最大限度地提高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屋!

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