Groups | Blog | Home
all groups > dotnet windows forms databinding > july 2005 >

dotnet windows forms databinding : AddHander Removal


Bill S.
7/28/2005 11:55:29 AM
Hi,
Is it possible to remove an event handler once it's installed with
AddHandler?

Below is the event I added and it works fine. Later in my code I want to
remove it. I tried using this statement: (AddHandler mOwner.CmdFirst.Click,
Nothing) to remove it, but this does not work. Help!

AddHandler mOwner.CmdFirst.Click, AddressOf CmdFirst_Click

Private Sub CmdFirst_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
mTraversalButtons.MoveFirst()
End Sub



Marina
7/28/2005 4:59:57 PM
There is a RemoveHandler that does just that.

[quoted text, click to view]

Mattias Sjögren
7/29/2005 9:31:57 AM
[quoted text, click to view]

Yes, with RemoveHandler



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
AddThis Social Bookmark Button