[Solved] Error closing forms on C#


An unhandled exception of type ‘System.ArgumentOutOfRangeException’
occurred in System.Windows.Forms.dll

This is because it can not find the element in you collection of images you are looking for.
You have to make sure the image you assign exists before you assign it.
In this care it is set top 15 which is not in your collection.

If(imageList1.Images.Count >= 15)
{
   pictureBox1.Image = imageList1.Images[i];
}

If the method runs when you close the program you are either closing the program at the wrong time or you have to let the method know that you are closing so it can skip the code. You could do that with a flag on the on closing event.

solved Error closing forms on C#