I am dynamically creating a collection of controls that are placed in a panel and each control has it's Dock property set to Top. Once the user is working with this control they can add additional controls and I need to place them between specific controls in the panel. Say for instance I have controls 1-5 and I would like to insert a new control before control 4 so I would end up with 1, 2, 3, 4, NEW, 5. The possibility exists that I would insert another control that again would go between New and 5, thus resulting in 1, 2, 3, 4, NEW, NEW1, 5.
I have looked into the SetChildIndex property, but setting it to 4 for the first scenario doesn't work, and resetting the controls to anything that I can think of totally screws up the layout.
Thanks for any help with this one.
Start Free Trial