简体   繁体   中英

.net framework listview itemchecked event called every time item is added

I am having a lot of trouble with some code because the ListView.ItemChecked Event is called every time an item is added to the listview. The only way I can manage to stop this is to check to see if the listview is in Focused when the even happens. But this feels really sloppy to me. Is there any other way to fix this?

Thanks

Is there any other way to fix this?

One option would be to remove the handles clause and use the Add/RemoveHandler statements to control when the handler will handle the events.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM