Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Removing Handler... URGENT

Removing Handler... URGENT

Scheduled Pinned Locked Moved Visual Basic
csharphelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shubhabrata Mohanty
    wrote on last edited by
    #1

    Hi, To remove Event Handlers from my all controls in the form, I want to use a generic code as follows. 1) Run through all controls in the Form 2) Run through all Events of a control using Reflection .GetEvents() 3) For each Event, I want to get the Delegate, so that I can remove all using GetInvocationList(). but .NET doesn't provide any property to get delegate for the Event Handler. Please help. How can I get the Delegate for the Event Handler.

    S 1 Reply Last reply
    0
    • S Shubhabrata Mohanty

      Hi, To remove Event Handlers from my all controls in the form, I want to use a generic code as follows. 1) Run through all controls in the Form 2) Run through all Events of a control using Reflection .GetEvents() 3) For each Event, I want to get the Delegate, so that I can remove all using GetInvocationList(). but .NET doesn't provide any property to get delegate for the Event Handler. Please help. How can I get the Delegate for the Event Handler.

      S Offline
      S Offline
      S Senthil Kumar
      wrote on last edited by
      #2

      Does EventInfo.EventHandlerType[^] work? Regards Senthil _____________________________ My Blog | My Articles | WinMacro

      S 1 Reply Last reply
      0
      • S S Senthil Kumar

        Does EventInfo.EventHandlerType[^] work? Regards Senthil _____________________________ My Blog | My Articles | WinMacro

        S Offline
        S Offline
        Shubhabrata Mohanty
        wrote on last edited by
        #3

        That only gives the Delegate type, but how to actually get the reference to the Delegate?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups