级联拆分器面板的 MDI 形式
我在主窗体内显示我的 MDI 窗口,但在拆分面板的一部分中,如下所示:
Form2 f2= new Form2();
f2.MdiParent = this;
f2.Parent = this.splitContainer2.Panel2;
f2.Show();
但问题是,如果我编写如下代码,则无法级联它们:
this.LayoutMdi(System.Windows.Forms.MdiLayout.Cascade);
“this”是父窗体。主要形式。
我可以级联它们吗?
谢谢大家。
I am showing my MDI windows inside the main form but in one part of the splitter panel, like this:
Form2 f2= new Form2();
f2.MdiParent = this;
f2.Parent = this.splitContainer2.Panel2;
f2.Show();
but the problem is that I cannot cascade them if I write a code like this:
this.LayoutMdi(System.Windows.Forms.MdiLayout.Cascade);
"this" is the parent form. the main form.
Hoe can I cascade them?
thanks all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须重写 SplitContainer 面板的 LayoutEngine。微软有一个很好的例子 这里用于创建自定义布局引擎。
只需将上面的代码添加到级联按钮中,您就可以了解级联的基础知识。
You'll have to override the LayoutEngine for the SplitContainer panel. Microsoft has a good example here for creating a custom layout engine.
just add the above code to your cascade button and you'll get the basics of cascade.