質問

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!

役に立ちましたか?

解決

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.

他のヒント

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;
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top