If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Threaded View

Swapping control into a different parent

Colleagues,

What I'm trying to achieve is kind of an undocking behavior, where a control can undock from one form and float in a different form. My code is based on a working reference design. Unfortunately, I ran into a problem. I’m getting an exception when I try to assign a different parent form to the control.

Code:

private void FloatPanel()
{
// this method resides in the new parent form for the control to float in
// m_ctrlContainer control, which will be swapped into a floating form
m_ctrlContainer.Parent = this; // throws exception “Collection is read only.”
}

The same exception happens if I call this.Controlls.Add(m_ctrlContainer). It looks like the parent is in a state where controls can’t be added to it. What can I do to add controls to it?

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.