我可以通过单击第一个孩子的按钮在同一MDI窗口中显示第二个孩子吗?



MDI 窗口加载时调用了第一个子项。 第一个孩子有一个按钮,我希望它可以在 MDI 窗口中调用第二个孩子。 我能把它变成真的吗?

当然可以...使用 MdiParent 属性:

// ... from one MdiChild ...
Form2 f2 = new Form2();
f2.MdiParent = this.MdiParent(); // make the new form have the same MdiParent as the current one
f2.Show();

最新更新