Domanda

i have two little questions to you: How to add several subforms to a form in C# like on the pictures below:

http://i.stack.imgur.com/ag1WD.jpg [Cascade]

http://i.stack.imgur.com/SzBGH.jpg [Tile]

And the second one is how to manage their position(Cascade, Tile, etc.). Thank you for your time!

È stato utile?

Soluzione

This is a Multiple Document Interface (MDI) form but, as Robert Harvey mentioned in a comment, there's probably a better way to build your UI.

To layout the child forms you will use the LayoutMdi method of the parent.

Altri suggerimenti

It's called MDI (Multiple Document Interface). To do that, you need to change the IsMdiContainer property of the MainForm to true. And then you need to change the MdiParent property of the child Forms to your MainForm instance.

You can have a method in your MainForm class like:

public void MakeChildForm(Form childForm)
{
    childForm.MdiParent = this;
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top