MDI 窗体内的可拖动 ToolStrip 控件
我有一个 .NET MDI(多文档界面)应用程序,我想使用可拖动的 ToolStrip 控件。我希望 ToolStrip 控件位于 MDI 窗体的顶部(就在菜单下方)。当我在 MDI 表单中使用标准 ToolStripContainer 时,我无法仅显示顶部对接条,它始终显示中心内容面板,并在我的 MDI 应用程序中隐藏子表单。我尝试将 ToolStripContainer 停靠设置为“顶部”(而不是“填充”),但内容面板仍然显示,并且当我有多行 ToolStrip 控件时,它无法正确调整大小。
有没有办法隐藏 ToolStripContainer 的内容面板,以便它在 MDI 表单中正常运行?如果没有,如何在 MDI 表单中获取可拖动的 ToolStrip 控件? MDI 应用程序中可拖动的 ToolStrip 似乎是一个常见的请求。
I've got a .NET MDI (multiple document interface) application that I want to use draggable ToolStrip controls. I want the ToolStrip controls to be at the top of my MDI form (just under the menus). When I use the standard ToolStripContainer inside the MDI form I can't show just the top docking strip, it always shows the center content panel and that hides and child forms in my MDI application. I tried setting the ToolStripContainer docking to "top" (instead of "fill") but the content panel is still shown and it doesn't resize correctly when I have multiple lines of ToolStrip controls.
Is there a way to hide the content panel of the ToolStripContainer so it plays nice in an MDI form? If not, how do I get draggable ToolStrip controls in an MDI form? It would seem like draggable ToolStrips in MDI applications would be a common request.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决方案!默认情况下,工具箱中未列出一个控件,该控件完全符合我的要求。它是 System.Windows.Forms.ToolStripPanel 控件。
I found the solution! There is a control that is not listed in the Toolbox by default that does exactly what I want. It is the System.Windows.Forms.ToolStripPanel control.