tags:

views:

32

answers:

1

Hello,

I have a combo box and I need to add an event to that combo box using C++/CLI.

eg:

pComboBox->DropDownOpened += gcnew EventHandler( pFunctor, &Functor::Handler );

But before adding this event, I need to check if this event is added, If it is, how can i remove the existing event?

A: 

Hello Hans Passan,

Thank you for your reply. I am using WPF controls in C++/CLI not winforms. My problem is that, when I add the event two times like, (I add this event in a loop)

pComboBox->DropDownOpened += gcnew EventHandler( pFunctor, &Functor::Handler ); pComboBox->DropDownOpened += gcnew EventHandler( pFunctor, &Functor::Handler );

and when we click on the dropdown button of combobox, then the combo box call the same event two times.

So I need to check that, if the event "EventHandler( pFunctor, &Functor::Handler )" is added, before adding the event to "pComboBox->DropDownOpened". How can I check this?

sabeesh