开发者

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

开发者 https://www.devze.com 2022-12-26 10:25 出处:网络
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 ( in开发者_开发技巧dex is not getting c

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 ( in开发者_开发技巧dex is not getting changed) , but still selectedindexchanged event is getting invoked. Do we have any ways to avoid this? C# .Net ( WinForms)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消