Groups | Blog | Home
all groups > vb.net controls > july 2005 >

vb.net controls : AddHandler Removal


Bill S.
7/28/2005 11:54:33 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



Herfried K. Wagner [MVP]
7/28/2005 7:05:39 PM
"Bill S." <wschacht1@comcast.net> schrieb:
[quoted text, click to view]

You are looking for the 'RemoveHandler' statement...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
AddThis Social Bookmark Button