473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Canceling Event Processing on a control

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
2 1082
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
4
by: welie | last post by:
I have a problem canceling a check box update when placing a check in it. Checkbox is not bound. Here is what happens. User clicks a check box. In the BeforeUpdate method of the control, if...
3
by: trint | last post by:
Ok, I have tried to do this with the System.Web.UI and can't find anything for the webform. It seems much easier for a Winform. Any help in trapping Webform keydown event and keyup event is...
11
by: Tore Halset | last post by:
Hello. I am trying to port an old java application from MS SQL Server to PostgreSQL running on Mac OS X. I have access to the java source code and can make modifications. I have tried with...
6
by: Kevin | last post by:
I come up with these questions during the day, do some research, and then look for experienced users' input. 1. In Access, we already know it's pretty much an automatic save if you enter data. ...
9
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
2
by: =?Utf-8?B?VG9u?= | last post by:
Hello, I want to understand teh benefits of ajax technology. Does anyone has a good website where AJAX EXTENSIONS is worked out so I really understand it. There a 2 main questions: 1) How about...
4
by: yumbelie | last post by:
Hi, I've got an issue where I've created a prototype that contains 2 methods, and a few private variables. The first method simply registers the second method to be an event handler for the...
8
by: Brad Walton | last post by:
Hello. First post, but been doing a bit of reading here. I am working on a project in Java, but decided to switch over to C# after seeing some of the additional features I can get from C#. One of...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.