在DataGridView RowValidation事件中捕获表单关闭事件 [英] Trapping the form close event in a DataGridView RowValidation event

查看:68
本文介绍了在DataGridView RowValidation事件中捕获表单关闭事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在DataGridView RowValidation事件中捕获表单关闭事件?

如果由于表单关闭事件触发了RowValidation,我想终止验证.

这些是我必须使用的参数:(System :: Windows :: Forms :: DataGridViewCellCancelEventArgs ^ e)

How do I trap the form close event in a DataGridView RowValidation event?

I want to terminate validation if the RowValidation is triggered as a result of a form close event.

These are the parameters I have to play with:(System::Windows::Forms::DataGridViewCellCancelEventArgs^ e)

推荐答案

在表单关闭事件之前触发RowValidation吗? ?如果不是,则可以在表单将要关闭的表单上设置一个私有变量,然后在RowValidation中使用该变量来中止表单将要关闭的表单.

最好的问候,
曼弗雷德(Manfred)
Is the RowValidation triggered before the forms Closing event? If not you could set a private variable on the form that the form is about to be closed and then use that in the RowValidation to abort if the form is about to be closed.

Best Regards,
Manfred


这篇关于在DataGridView RowValidation事件中捕获表单关闭事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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