0

我有两个小问题要问您:如何在 C# 中将多个子表单添加到表单中,如下图所示:

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

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

第二个是如何管理他们的位置(Cascade、Tile 等)。感谢您的时间!

4

2 回答 2

3

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.

于 2012-12-15T21:09:46.970 回答
3

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;
}
于 2012-12-15T21:09:49.280 回答