本文介绍了关闭按钮编码,警告消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望用户在按下关闭"按钮时得到警告. 我可以将警告消息放在_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.
更多推荐
关闭按钮编码,警告消息
发布评论