Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在处理一些代码时遇到了很多麻烦,因为ListView.ItemChecked每次将项目添加到列表视图时都会调用事件。我可以设法阻止这种情况的唯一方法是检查列表视图是否在事件发生时处于聚焦状态。但这对我来说真的很草率。有没有其他方法可以解决这个问题?
ListView.ItemChecked
谢谢
有没有其他方法可以解决这个问题?
一种选择是删除句柄子句并使用 Add/RemoveHandler 语句来控制处理程序何时处理事件。