mdi child detach reattach problem

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.
 
N

Nicholas Paldino [.NET/C# MVP]

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?
 
M

Marina

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

MDI Forms using MainMenu 1
MDI child forms acting strange? 1
How to maximize MDI child? 1
MDI Repaint Problem 6
MDI Application 10
ProgressBar while MDI child form is loading 4
MDI Child menu 1
MDI Behaviour 2

Top