简体   繁体   English

选项卡控件以MDI格式(VB.NET)处理子窗口

[英]Tab control to handle child windows in an MDI form (VB.NET)

My application uses an MDI form, and there are instances where the end user will need multiple child windows open at a time. 我的应用程序使用MDI表单,并且在某些情况下最终用户需要一次打开多个子窗口。 I need an easy way for the user to switch between windows, which made me think of using tabs kinda like Firefox, or like the tabs in the Visual Studio IDE up at the top where you can switch between open forms and code files. 我需要一种简单的方法让用户在窗口之间进行切换,这使我想到了使用类似于Firefox的选项卡,或者想像使用顶部Visual Studio IDE中的选项卡那样在其中可以在打开的窗体和代码文件之间进行切换。

I'm curious if there is a control in .NET that will already do this? 我很好奇.NET中是否有控件已经可以做到这一点? I would rather not re-invent the wheel if I can help it. 如果可以的话,我宁愿不重新发明轮子。 Google has failed me thus far. 到目前为止,谷歌使我失败了。

Here is a very handy MDI Window Manager control: 这是一个非常方便的MDI Window Manager控件:

http://www.codeplex.com/mdiwinman http://www.codeplex.com/mdiwinman

I know this sounds obvious but have you looked into the tab control. 我知道这听起来很明显,但是您是否已查看选项卡控件。 You can configure it so the tabs are at the top. 您可以对其进行配置,以使选项卡位于顶部。

Standard shortcut for this in Windows is Ctrl+Tab . Windows中对此的标准快捷方式是Ctrl+Tab

Edit: 编辑:
Have you looked at this article ? 你看这篇文章了吗?

You can use the tab control. 您可以使用选项卡控件。 For each open document, you can associate an instance of a class or user control (to handle the document) with a tab page. 对于每个打开的文档,您可以将类或用户控件的实例(以处理文档)与选项卡页相关联。 Sometimes it is useful to put a frame on the tab page and treat it like you would a form in a single document application. 有时将框架放在选项卡页上并像对待单个文档应用程序中的表格一样对待它很有用。

An alternative to tabs is the "traditional" MDI application. 选项卡的替代方法是“传统” MDI应用程序。 While this isn't considered socially acceptable any more, at least by many people, it's still supported in VB.net. 尽管至少在很多人看来,这已不再为社会所接受,但VB.net仍支持该功能。 To make an MDI app, create a parent MDI form. 要制作MDI应用,请创建父MDI表单。 This is a normal form with the IsMdiContainer property set to true. 这是将IsMdiContainer属性设置为true的普通形式。 A child form is a normal form with the MdiParent property set to the parent MDI form at runtime. 子窗体是普通窗体,其MdiParent属性在运行时设置为父MDI窗体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM