禁用datagridview的事件? [英] Disable the events of datagridview?
本文介绍了禁用datagridview的事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在点击添加新记录按钮时禁用datagridview临时的点击和其他事件,并在保存新记录时启用。
任何告诉我怎么做???
提前致谢
解决方案
您可以这样做:
声明一个公共变量为
public int flag = 0;
然后在你的添加新按钮点击事件
{
flag = 1 < /跨度>;
}
你的网格视图事件
{
if (flag!= 1 )
{
// 你的活动点击这里的东西
}
}
然后在保存新记录后设置flag = 0
如果这似乎是你的答案,请通知我..
I want to disable the click and others events of datagridview temporary when i click add new record button and it enable when new record is saved.
Any tell me how to do this??
Thanks in advance
解决方案
You can done it as:
Declare a public variable as
public int flag=0;
Then in your Add new button click event
{ flag=1; }
in Your grid view events
{ if(flag!=1) { //do your event click stuff here } }
Then set flag=0 after new record is saved
If if this seems your answer kind to inform me..
这篇关于禁用datagridview的事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文