[![Mastermind program][1]][1]
I teach a class in computer programming where we have been making a version of Master Mind.
An odd thing happened which I don't understand and can't duplicate. The playing board depicted above is created with a picturebox array, which -- as you will all know -- has to be created programmatically. As you would expect, the x and y coordinates were meant to be controlled by using new location coordinates.
One of the students must have changed a property in the panel. As a result of this change -- which I can't duplicate -- when the picture boxes were created on the fly, they would appear in the panel without being given any horizontal or vertical assignments! He couldn't figure out why they were locating incorrectly in a pattern that had nothing to do with the location variables. We placed apostrophes before all mentions of the x and y variables. We then eliminated them altogether. We then did the same to the location property, and so removed any and all location references. Nothing stopped the appearance of the boxes in an ungoverned array pattern. The pattern would change with the panel being expanded or contracted.
Unfortunately, one of the other students deleted the panel and when we replaced it with a new one -- problem solved. However, the result is that I don't know what particular property caused this anomaly. I've played around for half an hour enabling and disabling various properties but nothing. I can't duplicate what he did.
Does anyone reading this know what made this happen?
Okay, I figured it out. He inserted a flowlayoutpanel instead of a regular panel. So, this question can be deleted or left for someone else who might encounter the same thing.