user315498
user315498

Reputation: 21

Combobox selectedindex changed event is getting invoked even when index is not changed

I have few items in combobox, i am selecting one item in that, selectindexchanged event is getting invoked. Then i am clicking on it and selecting the same item ( index is not getting changed) , but still selectedindexchanged event is getting invoked. Do we have any ways to avoid this? C# .Net ( WinForms)

Upvotes: 1

Views: 789

Answers (1)

K2so
K2so

Reputation: 982

Did you try debugging it to see where (if) the selected index has changed?

Else you can do a check in the event handler to see whether it's the same item selected or not, which you would do nothing if it is the same one.

Upvotes: 1

Related Questions