“Collection was modified; enumeration operation may not execute.” on form disposal?

If this is the case, the broken collection would be the collection of controls on the form.

I'm not sure how I would have broken anything... All I changed was the code seen in FirstForm. I feel like this shouldn't break anything... – Dan Rasmussen May 18 '10 at 22:00.

The problem was a PowerPacks. RectangleShape object I had placed on my second form and forgot about (because it wouldn't render. ) I deleted the object, and the form disposed just fine.

Testing this further, I found that any control which requires a PowerPacks. ShapeContainer (LineShape, OvalShape, and RectangleShape,) cause this problem, but other PowerPacks objects don't. I'm not sure why this happens, so if anyone figures out a workaround, it'd be appreciated, but for now I'll avoid PowerPacks shapes.

If you click multiple times, then the reference in FirstForm may no longer point to whatever you are closing. Try private void button1_Click(object sender, EventArgs e) { var second = new SecondForm(); second.Show(); }.

No, don't dispose a form right after showing it. – Hans Passant May 18 '10 at 23:35 Even if I only create a single instance of the second form, it doesn't dispose properly. – Dan Rasmussen May 19 '10 at 4:53 @Hans - oops :) I blame...myself.

The original point stands though. Code edited. – µBio May 19 '10 at 16:01.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions