Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / July 2007

Tip: Looking for answers? Try searching our database.

Canceling Event Processing on a control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JohnR - 06 Jul 2007 03:31 GMT
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
Blake - 06 Jul 2007 04:00 GMT
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.

>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
[quoted text clipped - 11 lines]
>
> Thanks,  John
JohnR - 06 Jul 2007 05:07 GMT
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

> There is a protected readony property Events on forms, that details
> all of the attached event delegates.
[quoted text clipped - 17 lines]
>>
>> Thanks,  John

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.