mdi child detach reattach problem

  • Thread starter Thread starter Marina
  • Start date Start date
M

Marina

We have MDI WinForms C# .Net2 application.
Parent form has MdiContainer=true;

Children forms are created like this:
Form child = new Form();
child.MdiParent = this;
child.Show();


To detach mdi child I use:
child.MdiParent = null;


If user wants to reattach child form back:
child.MdiParent = parent; where parent is original parent of the form


child form is added to list of MdiChildren and becomes active,
however
I can't click between Mdi Child forms the way I could before, the
only
way to get child form active is to click at its header.


It is easily reproducable on small example.
 
Marina,

I don't think that the MdiParent property is meant to be changed once
you set the parent. The question is, why are you setting the parent to
null, and then setting it back?
 
Marina,

I don't think that the MdiParent property is meant to be changed once
you set the parent. The question is, why are you setting the parent to
null, and then setting it back?

--
- Nicholas Paldino [.NET/C# MVP]



We have MDI WinForms C# .Net2 application.
Parent form has MdiContainer=true;
Children forms are created like this:
Form child = new Form();
child.MdiParent = this;
child.Show();
To detach mdi child I use:
child.MdiParent = null;
If user wants to reattach child form back:
child.MdiParent = parent; where parent is original parent of the form
child form is added to list of MdiChildren and becomes active,
however
I can't click between Mdi Child forms the way I could before, the
only
way to get child form active is to click at its header.
It is easily reproducable on small example.- Hide quoted text -

- Show quoted text -

User might decide that he wants to attach window back. If it is the
wrong way to detach/reattach mdi child, what is the right one?
 
Back
Top