| 发表于:2007-01-16 16:21:463楼 得分:4 |
在窗体上添加如下重写的代码就可以了: protected override void onclosing(canceleventargs e) { if (this.textbox1.modified) { dialogresult dr = messagebox.show(this, "是否保存文档? ", messageboxbuttons.yesnocancel); if (dr == dialogresult.yes) { this.savedocument(); } else if (dr == dialogresult.cancel) { e.cancel = true; } } base.onclosing(e); } | | |
|