E
E
evgeniy_matveev2019-10-08 10:37:00
C++ / C#
evgeniy_matveev, 2019-10-08 10:37:00

Why doesn't the display and state of the checkedListBox match?

Good afternoon. Problem with checkedListBox
Using itemCheck event

private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
        {            
            label1.Text = e.CurrentValue.ToString();
        }

5d9c3b8779a62539918630.png
When the event is called again, the previous state of the item is displayed.
Maybe there is an event in which you can track the already changed state of the items in the checkedListBox?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
evgeniy_matveev, 2019-10-08
@evgeniy_matveev

Understood. In the itemCheck event, there are two options for the state of the item, currentValue and newValue.
You need to use newValue.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question