windows 如何使 MdiChild 表单位于 C# 中的选项卡中?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6234509/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I make MdiChild forms be in tabs in C#?
提问by Pedrum
I have a MDIparent Forma and which has some mdichild forms in it. Can you help me some how put the mdichilds in Tabs like google chrome , firefox , IE , Opera ...
我有一个 MDIparent Forma 并且其中有一些 mdichild 形式。你能帮我看看如何将 mdichilds 放在标签中,比如谷歌浏览器、火狐、IE、Opera ......
采纳答案by Daniel Walker
There's a good article on MDI forms with TabControls here: http://www.codeproject.com/KB/cs/MDITabBrowsing.aspx
这里有一篇关于带有 TabControls 的 MDI 表单的好文章:http: //www.codeproject.com/KB/cs/MDITabBrowsing.aspx
回答by David Heffernan
There's nothing really to be gained by using MDI once you have tabs.
一旦有了选项卡,使用 MDI 就没有什么真正的好处。
MDI is designed to handle multiple forms residing inside the same container. However, with tabs each form is in a different container. I can't see any benefit to using MDI in this scenario and would avoid it.
MDI 旨在处理驻留在同一容器内的多个表单。但是,对于选项卡,每个表单都位于不同的容器中。我看不出在这种情况下使用 MDI 有任何好处,并且会避免它。
回答by Bahaa Salaheldin
Try something like this:
尝试这样的事情:
myForm.TopLevel=false;
myForm.TopMost=false;
tabPage1.Controls.Add(myForm);