关闭按钮编码,警告消息 [英] Close button coding, warning message
本文介绍了关闭按钮编码,警告消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望用户在按下关闭"按钮时得到警告.
我可以将警告消息放在_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
推荐答案
查看此链接:
http://msdn.microsoft.com/en-us/library/system. windows.window.closing.aspx [ ^ ]
基本上,您可以设置e.Cancel = true
取消关闭,反之亦然.
希望对您有所帮助.
Check out this link :
http://msdn.microsoft.com/en-us/library/system.windows.window.closing.aspx[^]
Basically, you can sete.Cancel = true
to cancel the closing and vice-versa.
Hope it helped.
这篇关于关闭按钮编码,警告消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文