Hi all,

I want to ask you for little help. I make application in C#. It is made from one main form and it would be great if I can use as a part of it another "small forms" (I want to let user drag them on screen where they want). I have problem to describe it :) I want to make something like tool, colors layers or history box in Paint.NET.

http://www.getpaint.net/screenshots/pdn35_kirkland.jpg

You can drag them where you want, close them or open again while main form is intacted. But you also can minimalize whole app in the tray (at once, not window by window).

But how? Is there some trick? Or I just cats "minimalize" event and change hide/close all windows? Thx for reply to all!

Thank you for your reply! Thats what I need :)

But a little problem here - I use MSDN article http://msdn.microsoft.com/en-us/library/7aw8zc76.aspx and button on main form runs this code:

this.IsMdiContainer = true;

   Form2 newMDIChild = new Form2();
   newMDIChild.MdiParent = this;
   newMDIChild.Show();

...but nothing happened. When I delete line "newMDIChild.MdiParent = this;" it is working, but of course not like parent & child. Can you help me fin out where can be mistake?

EDIT: There is big picture above whole form (not as background). But it can not affect this, am I right?

Edited 5 Years Ago by RossR: n/a

Try setting the IsMdiContainer property from the properties box. (Not in your event method)

You can set IsMdiContainer to true within the Form1.Designer.cs file or after InitializeComponent() in the forms constructor.

Edited 5 Years Ago by iconoclazt: n/a

I find out, that problem is in picturebox and other components of MainForm. Situation:

Mainform with some buttons and big picturebox which covers whole form (like background). I create MDI child, it is there - but it is "under" all parts which are on MainForm. So this big image overlaps it. I need to get MDI Child in the front of it (BringToFront does not work, Form.TopMost does not work).

OK, after few hours of testing I have nothing :/. I find some thread where was guy trying to do same thing. They also did not find any solution.

So I change the way, use regular forms, catch events of minimalization/maximalization and apply them to all forms.

This article has been dead for over six months. Start a new discussion instead.