关闭按钮编码,警告消息

编程入门 行业动态 更新时间:2024-10-26 23:40:46
本文介绍了关闭按钮编码,警告消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我希望用户在按下关闭"按钮时得到警告. 我可以将警告消息放在_FormClosing事件中,但是如果用户选择停止它,我不知道如何停止关闭. 谢谢 Furqan

Hi, I wish that user gets a warning when Close button is pressed. I can put the warning message in _FormClosing event but I donot know how to stop closing if user choses to stop it. Thanks Furqan

推荐答案

查看此链接: msdn.microsoft/en-us/library/system. windows.window.closing.aspx [ ^ ] 基本上,您可以设置e.Cancel = true 取消关闭,反之亦然. 希望对您有所帮助. Check out this link : msdn.microsoft/en-us/library/system.windows.window.closing.aspx[^] Basically, you can set e.Cancel = true to cancel the closing and vice-versa. Hope it helped.

更多推荐

关闭按钮编码,警告消息

本文发布于:2023-10-16 06:09:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1496716.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:按钮   消息

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!