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

Canceling Event Processing on a control

P: n/a
I know about AddHandler and RemoveHandler, but my requirement is a little
more complex. I pass a form to a routine. In that routine I must scan each
control, and for each "button" control I find, I must delete it's "click"
event handler. I can't see how to do this using RemoveHandler because I
don't know the name of the delegate handling the event.

So, somehow, having just the control, I need to dynamically see if it's
"click" event is being handled, and by what routine.

Is there a way to find out if a "click" event is being handled for a
control, and then removing that event handler?

BTW I'm still using .Net 1.1 if it makes a difference.

Thanks, John
Jul 6 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
There is a protected readony property Events on forms, that details
all of the attached event delegates.

Because it is protected you may need to add your code to the form instead
of the external routine, and then call the form code from your routine.

"JohnR" <Jo******@hotmail.comwrote in message
news:KPhji.10872$vG2.10126@trnddc02...
>I know about AddHandler and RemoveHandler, but my requirement is a little
more complex. I pass a form to a routine. In that routine I must scan
each control, and for each "button" control I find, I must delete it's
"click" event handler. I can't see how to do this using RemoveHandler
because I don't know the name of the delegate handling the event.

So, somehow, having just the control, I need to dynamically see if it's
"click" event is being handled, and by what routine.

Is there a way to find out if a "click" event is being handled for a
control, and then removing that event handler?

BTW I'm still using .Net 1.1 if it makes a difference.

Thanks, John
Jul 6 '07 #2

P: n/a
Hi Blake,

Sorry, but I must be missing something. I set a breakpoint in the form
code and tried to look at "me.events" which got me to a list the quickview
couldn't display, so I tried "me.events.item(0)" and it had a value of
nothing. "me.events" is returning a eventhandlerlist, but that list seems
to be empty.

I tried playing around with it for awhile and couldn't get anything.
Could you be a little more specific on what I need to do?

Thanks, John

"Blake" <no@emailwrote in message
news:OR**************@TK2MSFTNGP06.phx.gbl...
There is a protected readony property Events on forms, that details
all of the attached event delegates.

Because it is protected you may need to add your code to the form instead
of the external routine, and then call the form code from your routine.

"JohnR" <Jo******@hotmail.comwrote in message
news:KPhji.10872$vG2.10126@trnddc02...
>>I know about AddHandler and RemoveHandler, but my requirement is a little
more complex. I pass a form to a routine. In that routine I must scan
each control, and for each "button" control I find, I must delete it's
"click" event handler. I can't see how to do this using RemoveHandler
because I don't know the name of the delegate handling the event.

So, somehow, having just the control, I need to dynamically see if it's
"click" event is being handled, and by what routine.

Is there a way to find out if a "click" event is being handled for a
control, and then removing that event handler?

BTW I'm still using .Net 1.1 if it makes a difference.

Thanks, John

Jul 6 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.