Detect if an event has event handler

  • Thread starter Thread starter bz
  • Start date Start date
B

bz

Hi,

I need to bind the dropdown event to an event handler, but not from
beginning (in form's load or constructor), but little bit later, when
a background process completes.

Is there any way to detect if I already bound a handler to the event
(to not bind the handler several times)

Thank you
 
Is there any way to detect if I already bound a handler to the event
(to not bind the handler several times)

The easiest way is to just keep track of that in a boolean field.


Mattias
 
Hi,

if you attach the same handler from the same object instance twice, it will
still be only called once.

Kind regards,
Henning Krause



The easiest way is to just keep track of that in a boolean field.

I thought maybe it is a more elegant way

Thanks
 
if you attach the same handler from the same object instance twice, it will
still be only called once.

No, it will be called once for each time you add it.


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top