Which CheckedListBox event triggers after a item is checked?

前端 未结 12 569
攒了一身酷
攒了一身酷 2020-11-28 13:24

I have a CheckedListBox where I want an event after an item is checked so that I can use CheckedItems with the new state.

Since ItemChecked is fired before

12条回答
  •  青春惊慌失措
    2020-11-28 13:39

    Although not ideal, you can calculate the CheckedItems using the arguments that are passed through to the ItemCheck event. If you look at this example on MSDN, you can work out whether the newly changed item has been checked or unchecked, which leaves you in a suitable position to work with the items.

    You could even create a new event that fires after an item is checked, which would give you exactly what you wanted if you wished.

提交回复
热议问题