简体   繁体   English

c#最大化,最小化和关闭表单上的按钮

[英]c# Maximize, Minimize and Close buttons on form

Hi Is there any way to find out if the close button (x button on form) was clicked. 嗨,有什么方法可以找出是否单击了关闭按钮(窗体上的x按钮)。 However without involving FormClosing and FormClosed events ? 但是不涉及FormClosing和FormClosed事件吗?

Without those Events? 没有那些活动? That's a tough one...no, I don't think so. 这是一个艰难的过程……不,我不这么认为。

I mean, you hook yourself into the message pump of the form to figure out if those actions were invoked, but seems like a little overkill to me. 我的意思是,您将自己吸引到表单的消息泵中以弄清楚是否调用了这些操作,但对我来说似乎有点过大了。

您可以使用PreProcessMessage来查看表单中的消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 c# 表单最小化/最大化按钮不见了? - c# Form Minimize/Maximize Buttons gone? C#如何获取窗体边框按钮的大小[最小化/最大化/关闭] - C# How to get the size of the form border buttons [Minimize/Maximize/Close] SetWindowsHookEx,然后单击冻结表单上的最小化/最大化/关闭按钮 - SetWindowsHookEx and clicking minimize/maximize/close buttons on form freezing 更改工具提示 c# winform 的最小化最大化或关闭按钮 - Change tooltip c# winform of minimize maximize or close button 禁用最小化按钮,但保持交叉和最大化按钮 - WPF,C# - Disable Minimize Button, but Keep Cross and Maximize Buttons - WPF, C# 最小化/最大化/关闭按钮的工具提示和Devexpress lookAndFeel - Minimize/Maximize/Close buttons' tooltip and Devexpress lookAndFeel WPF C#中的自定义“关闭”,“还原”,“最小化”按钮 - Customized Close, Restore, Minimize buttons in WPF C# 覆盖标题栏按钮的工具提示文本(关闭,最大化,最小化,帮助) - Override tooltip text for Titlebar buttons (Close, Maximize, Minimize, Help) 如何创建带有关闭,最大化和最小化按钮的PictureBox? - How can I create a PictureBox with close, maximize, and minimize buttons? WPF RibbonWindow 最小化、最大化/恢复和关闭按钮不可见 - WPF RibbonWindow Minimize, Maximize / Restore, and Close Buttons Not Visible
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM