DatagRdiView单元格文本更改事件 [英] DatagRdiView cell text change event

查看:134
本文介绍了DatagRdiView单元格文本更改事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我创建了一个vb.net应用程序,并在其中使用了DataGridview.但是我遇到的问题是,我想要在datagridview中不存在的cell textchanged事件.所以现在我将处理程序添加为

Hello,
I have created an vb.net application and in that i used a DataGridview.But i got an problem is that ,I want the cell textchanged event which is not present in datagridview.So now I added handler as

 AddHandler DataGridView1.EditingControl.TextChanged, AddressOf Dg_TextChanged

Private Sub Dg_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.TextChanged
          MsgBox("Hello")
End Sub



现在的问题是,我想在需要的地方删除处理程序..请帮助我..

假设我通过
删除了处理程序



Now the problem is that i want remove the handledler wherever I want ..please help me..

Suppose I removed the handler by

RemoveHandler DataGridView1.CellLeave, AddressOf Dg_TextChanged



仍然在发生texh chnage事件时,它会自动调用Dg_TextChanged事件,而我不希望这样..
请帮帮我....
谢谢.



still when form texh chnage event occurs it automatically calls the Dg_TextChanged event and I dont want that..
Please help me....
Thank You.

推荐答案

您的TextChanged处理程序也已设置为处理表单的textchanged事件,请查看此处

私有Sub Dg_TextChanged(ByVal发送者作为对象,ByVal e作为System.EventArgs) Handles Me.TextChanged.

如果要以编程方式添加和删除处理程序,则应删除它.

希望对您有帮助
Your TextChanged handler is also set to handle your forms textchanged event, look here

Private Sub Dg_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.TextChanged.

you should remove that if you want to programmatically add and remove the handler.

Hope this helps


这篇关于DatagRdiView单元格文本更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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