While I can easily accomplish in ASP.NET using AddAt(), I am trying to do the same thing in Windows Forms.
I have a panel, and while I can do a pnlMyPanel.Controls.Add(ctl) … it always inserts it in the 0 position, when I would rather have it appended to the end, or pnlMyPanel.Controls.Count.
Am I overlooking a method or am I going to have to do something else?
It depends how your controls are being laid out.
I assume that all of the controls in the panel have their
Dockproperty set. If so, callBringToFront,SendToBack, orSetChildIndexon the new control after adding it to the panel.If not, set the
TopandLeftproperties (or theLocationproperty) of the new control.