My
m_ctrlContainer
was a "built-in" panel of a SplitContainer (as in
splitContainer1.Panel1
). That's why the collection was read-only. Well duh.
This code had pointed me in the right direction.
m_ctrlContainer.Parent.Controls.Remove(m_ctrlContainer);
this.Controls.Add(m_ctrlContainer);
Subsequently, I've replaced the SplitContainer with separate splitter and panels. The hierarchy, obviously, now looks like this:
Form1
- panel1
- splitter1
- panel2
That made explicit un-parenting and re-parenting work. Implicit un-parenting works as well.
m_ctrlContainer.Parent = this;
Thanks to all for your support and advice!
- Nick