disable selecteditemchanged event

  • Thread starter Thread starter Ziver MALHASOGLU
  • Start date Start date
Z

Ziver MALHASOGLU

Hello,

i want to temporary disable the listBox object's selectedItemChanged event.
how can i achieve this?

Regards,
Ziver
 
Hi,

You would need to keep a reference to the assigned handler:
EventHandler listboxhandler = new EventHandler( theHandlerMethod );

So you can enable it:

listbox.SelectedItemChanged += listboxhandler;

or disable

listbox.SelectedItemChanged -= listboxhandler;

at your will.


Hope this help,
 

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