By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,625 Members | 1,283 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,625 IT Pros & Developers. It's quick & easy.

Remove Event Handle dynamically in C#

P: n/a
How can I remove a event handle dynamically?

I knew that, it is the proper way to add a event handler for a control

Add Handler
-----------------------------------------------
this.button1.Click += new System.EventHandler(this.button1_Click);

Remove Handler
------------------------------------------------
button1.Click -= new System.EventHandler(button1_Click);

But I want some other way which is more easy, which doesn't need to
supply the old method pointer(name) in the procedure..

A good example is like example below ( written in Delphi )
button1.onClick := nil;

Does anyone can help me or give me a hint. TQ...

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Have you tried the syntax RemoveHandler object.EventA, AddressOf
Me.EventHandler
--
data mining and .net team
http://www.visual-basic-data-mining.net/forum
"Jensen Hoh" <so*******@yahoo.com> wrote in message
news:uS**************@TK2MSFTNGP11.phx.gbl...
How can I remove a event handle dynamically?

I knew that, it is the proper way to add a event handler for a control

Add Handler
-----------------------------------------------
this.button1.Click += new System.EventHandler(this.button1_Click);

Remove Handler
------------------------------------------------
button1.Click -= new System.EventHandler(button1_Click);

But I want some other way which is more easy, which doesn't need to
supply the old method pointer(name) in the procedure..

A good example is like example below ( written in Delphi )
button1.onClick := nil;

Does anyone can help me or give me a hint. TQ...

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 21 '05 #2

P: n/a
Jensen,

Any reason why you ask this in the VBNet newsgroup?

Cor.

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.