C# Not Disposing controls like I told it to

后端 未结 4 1031
时光取名叫无心
时光取名叫无心 2021-01-26 21:34

I have a Panel control. And inside the panel users can add combobox\'s, textbox\'s labels etc and drag them around and stuff, and there\'s a Delete button on my form where if th

4条回答
  •  無奈伤痛
    2021-01-26 21:46

    I have seen this before, you are removing items from acollection that make the collection itself smaller. e.g if there are 5 items in the collection as you move down through it you come to the end of the list sooner than you expect because the list gets smaller with every Dispose() you issue.

提交回复
热议问题