关闭按钮处理程序 [英] Close button handler

查看:98
本文介绍了关闭按钮处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以知道当我点击winform右上角的关闭按钮时,我应该打电话给哪个处理程序?我有一个功能,它会显示一个消息框,在单击关闭按钮时询问用户确认消息。但我不知道应该在事件下放置功能的位置。任何帮助将不胜感激。

Hi, may i know when i clicked on the close button on the top right corner of my winform, which handler should i call? I have a function which will display a message box to ask user the confirmation message when the close button is clicked. But I have no idea on where the function should be placed under the Events. Any help would be appreciated.

推荐答案

处理 Form.FormClosing [ ^ ]事件 - 如果需要,可以在那里取消。
Handle the Form.FormClosing[^] event - you can cancel it there if you need to.


这篇关于关闭按钮处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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