如何检查事件是否被处理 [英] How to check event if event is handled or not
本文介绍了如何检查事件是否被处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友们,
我需要测试事件中是否已经存在事件处理功能.请查看代码,
启用
Hi friends,
I need to test if the the event handling function is already present in the event. Please see the code,
public bool enabled
{
set
{
if (enabled)
dgDrugs.CellValueChanged += new DataGridViewCellEventHandler(dgDrugs_CellValueChanged);
else
dgDrugs.CellValueChanged -= new DataGridViewCellEventHandler(dgDrugs_CellValueChanged);
}
get
{
// here I want the code to test if it cell value changed is passed or not
if (dgDrugs.CellValueChanged is dgDrugs_CellValueChanged)
return true;
else
return false;
}
}
谢谢您的帮助...
关于
Thank you for the help...
Regards
推荐答案
所有ya''都需要做.
That all ya'' need to do.
return ( dgDrugs.CellValueChanged != null );
这篇关于如何检查事件是否被处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文