When using the "BringToFront()", "SendToBack()", or "SetChildIndex()" methods on a group of child controls, the resultant z-order can be unpredictable when the "Visible" property of the child controls is set to false. Especially when the controls are part of a fairly large set (70 or more)

However, when the "Visible" property of the controls is set to true, all 3 of the methods work predictably

In my particular program, a panel control was created.... and then a group of ~60-70 label controls were added as children of the panel. As each was added, the "Visible" property was set to false. Then, after all were added, the z-order was re-arranged using calls to the the "SetChildIndex()" method. The resultant z-order was incorrect, and also was not predictable (not the same on subsequent runs of the program -- despite all else being the same)

As a quick fix, I set the "Visible" property to true for each child control from the outset, and then used the "SetChilIndex()" method upon the children. Everything would then work fine

This was a very nasty bug. Took a few days of analysis/debugging to find it. Hope this helps others who have the same problem

Jim.