I have the following code that creates a button:
Dim B as new Button B.Parent = my BLocation = New Point (50, 50) AddHandler B.Click, sub () MsgBox ("Hi") End Sub 'and click to get an event information for the event inorder event Trying to get the handler, it can remove FieldInfo as the dim FieldInfo = B.GetType.GetField ("Click", BindingFlags. [Static] or BindingFlags.NonPublic or BindingFlags.Public) = FieldInfo.GetValue as a slow obj object (Obj_) Dim EI Form EventInfo = Obj_.GetType GETEvent (EventName) EI.RemoveEventHandler (Obj_, obj)
But FieldInfo consistently redundant. I tried several incident names with ClickEvent, EventClick ... but none of them allow me to get results.
Does anybody know what's missing in my code please?
Thank you in advance.
I suggest you go through this -
Get the representation of the EventInfo object, and get the type of representative used to handle the event using the EventHandlerType property. An EventInfo is received for this function click in the following code
Code snippet:.
Dim EvClick as EventInfo = tExForm.GetEvent ("click") dim tDelegate type = evClick.EventHandlerType
as you
type.GetEvents ()
), add another handler (can get EventInfo. AddEventHandler ()
) or a handler (EventInfo.RemoveEventHandler ()) Delete
. You will have to do something to get the list of attached representatives.
Reference:
Comments
Post a Comment