I have a simple Windows form containing, among other components, a ListView object called list . In the form, the button allows me to clear the list when I click on list.Items.Clear() . It works great.
Now I have a separate Test class, whose method update() is called on some events external to the form. When building the form, I pass the link to the list using the SetList method. In debug mode, update() is called on events that I fire, and its contents are executed, but my list is not cleared.
Why is this? The link is set correctly, I checked.
class Test { private ListView list; public void setList(ListView list) { this.list = list; } public void update() { this.list.Items.Clear(); } }
when I look closer, when my list changes, putting breakpoints in update (), the list is cleared and cleared. This seems to be another list that is changing, but I only have one, and I never do any new ones on it ... ????
Jerome
source share