SplitContainer 的面板作为其他窗体的 MDI 父级
我有一个添加了 Splitcontainer
的控件。我想放置 第二个面板 (Panel2
) 上的另一个表单。然而,这是不可能的 将全新表单的 MDIParent
属性设置为 Panel2
。
因此,问题是 - 如何将 SplitContainer's
面板设置为另一个控件的 MDIParent
?
预先感谢您的线索!
干杯
I have got a control with a Splitcontainer
added. I want to place
another forms on the second panel (Panel2
). However, it is not possible to
set the MDIParent
property of a brand new form to Panel2
.
Thus, the question is - how can I set the SplitContainer's
panel as the MDIParent
for another controls?
Thank you in advance for the clues!
cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果你想制作Panel-Splitter-MdiClient Form,请参阅c#中的面板和MDI< /a>
If you want to make Panel-Splitter-MdiClient Form see panel and MDI in c#
MDIParent 只能是另一个表单。您需要做的就是在子表单上将
TopLevel
设置为 False。然后,您可以将其添加到任何控件,就像添加到任何其他控件一样(通过将其添加到父控件的Controls
集合中)。但是,它不会像在 MDI 容器中那样工作(因为您无法最小化或最大化它)。An MDIParent can only be another Form. What you need to do is set
TopLevel
to False on the child Form. Then you can add it to any control just like it was any other control (by adding it to the parent control'sControls
collection). However, it won't work like it does in an MDI container (as in you won't be able to minimize or maximize it).如果您的目的是使用 splitcontainer 加载不同的子表单,这可能会有所帮助。您可以使用从包含普通 WinForm 拥有的所有小部件的面板派生的类,而不是使用 WinForms。要显示它们,只需将它们添加到 splitcontainer 的 Panel2 控件集合中即可。
要记住的一些事件和方法是:
If your intent is to use the splitcontainer to load different subforms this may help. Instead of using WinForms, you could use classes derived from panels containing all the widgets that a normal WinForm would have. To display them, simply add them to your splitcontainer's Panel2 controls collection.
Some events and methods to keep in mind are: