Advertisement

03.26.2008 at 05:33AM PDT, ID: 23270123
[x]
Attachment Details

Insert into middle of Forms Controls Collection

Asked by nesoftware in Visual Studio .NET 2005

Tags: C# VB.Net, Windows Forms

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
[+][-]03.26.2008 at 08:25AM PDT, ID: 21212633

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 10:51AM PDT, ID: 21214373

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 11:19AM PDT, ID: 21214637

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Studio .NET 2005
Tags: C# VB.Net, Windows Forms
Sign Up Now!
Solution Provided By: VBRocks
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628