0

I'm trying to implement some complement views inside my application and I would like to have a better layout control over them. I don't know how to explain in words what my desired functionality is, so I made it through with some photoshop help, hoping you could give me a hand to implement it.

My application now looks like this:

(i need reputation to post images so.. sorry for the links) http://i59.tinypic.com/2ikv8m1.jpg

When I minimize the modeless form which is focused in the previous image, I would like to be able to see it (and handle it to maximize or close) inside my main form as I show in the image below (made it in photoshop)

http://i58.tinypic.com/1e28go.jpg

Hope someone can lead my into a solution and thanks for the support.

EDIT: I need to be able to move that form outside my main form, even to a different monitor.

  • the images are way too small for *me* to see *any* detail illustrating what you are after – Ňɏssa Pøngjǣrdenlarp Dec 29 '14 at 23:34
  • Set the MdiParent property of that form equal to the main form. Something like form2.MdiParent = form1. – MikeG Dec 29 '14 at 23:37
  • you could try MDI forms which automatically minimize to just the title bar, else change the size to something small (Windows will restrict it to a width of 132 and a Height of 38 according to [this question](http://stackoverflow.com/questions/7129417/resize-a-net-windows-form-to-a-small-size) when minimizing, check [here](http://stackoverflow.com/questions/1052913/how-to-detect-when-a-windows-form-is-being-minimized) how to see if the form is minimizing, and just change the location to the bottom left – grabthefish Dec 29 '14 at 23:39
  • I've tried what you've said about MdiParent but no succes on that. Actually, the second form just flashes in the screen and Output console shows 'thread has ended with code 0'. – Lautaro Rodriguez Garrido Dec 30 '14 at 01:02
  • @Plutonix I've uploaded the images to another host which allows me a higher resolution. Hope it works! – Lautaro Rodriguez Garrido Dec 30 '14 at 01:54

2 Answers2

0

If you don't want to use the MDI approach, then set TopLevel of the modeless Form to false and add it to the main Forms Controls collection before showing it:

        Form frm = new Form();
        frm.TopLevel = false;
        this.Controls.Add(frm);
        frm.Show();

*Obviously changing Form to the correct type of your modeless form.

Idle_Mind
  • 38,363
  • 3
  • 29
  • 40
  • Hi! I've tried this approach but definitly is not what is was looking for :c! When I minimize the form it directly disapears from the screen and I can't get to it again. Also, I'm using a new form because I need to be able to move that form outside my main form, even to a different monitor. Thx for the approach, I'm sure it will solve another similar problem in the future haha. – Lautaro Rodriguez Garrido Dec 30 '14 at 16:44
  • If you need to move that form outside the main one then this approach (and the MDI approach) are not viable. You could add a ToolStrip with Buttons across the Top of your Form to open your modeless forms and then simply hide them when they are minimized. This way the user always has something to click on to retrieve the form? – Idle_Mind Dec 30 '14 at 16:50
  • At last, if nothing that really gets the point I'm trying reach appears, this could be an interesting alternative.. – Lautaro Rodriguez Garrido Dec 30 '14 at 22:30
0

If i understand what you are trying to do, you want to minimize a certain form but still see it within your app (im assuming like Excel or Word)

You can do something similar to what Idle_Mind said, but enclose both in a Form instead of the parent. Form fParent = new Form(); fParent.Dock = DockMode.Fill;//i think this is the syntax. Use this if you want the form to fill to the screen Form fChild = new Form(); fChild.TopLevel = false; fParent.Controls.Add(fChild); fChild.Show();

Here, it should minimize to the lower left part of the parent form. You can then size the parent to whatever you want it to be.

brhardwick
  • 3,065
  • 2
  • 15
  • 17