简体   繁体   English

如何在另一个窗体(如Visual Studio)中显示窗体

[英]How to display a form inside another form like Visual Studio

How does Visual Studio and other similar programs display a form in their IDE? Visual Studio和其他类似程序如何在其IDE中显示表单?
Is it possible to achieve the same or a similar effect using C# or VB.NET? 使用C#或VB.NET是否可以达到相同或相似的效果?

Please see the picture below to get what I mean. 请查看下面的图片以了解我的意思。

Visual Studio IDE with a form in design view

If you are talking about hosting a Winforms editor in your code, it is entirely possible and is actually built in to the .NET framework! 如果您要谈论在代码中托管Winforms编辑器,那完全有可能,并且实际上内置于.NET框架中!

The Essence is the IDesignerHost interface. 本质是IDesignerHost接口。 The whole system is complicated, but can be done (I have done it in production code for runtime layout configuration editing). 整个系统很复杂,但是可以完成(我已经在生产代码中完成了,用于运行时布局配置编辑)。 There is a sample of code from Microsoft here . 有一个从微软的代码样本这里

I'm sure if you search fir 'IDesignerHost' you'll find enough reference material to figure it out. 我敢肯定,如果您搜索“ IDesignerHost”,您将找到足够的参考资料来弄清楚它。

Are you speaking about UI creating tools? 您是否在谈论UI创建工具? Refer to http://www.icsharpcode.net/opensource/sd/ - SharpDevelop for deep dive. 请参考http://www.icsharpcode.net/opensource/sd/-SharpDevelop ,以进行深入研究。 It's open sourse, so you'll be able to find out more details. 它是开放式的,因此您可以找到更多详细信息。

我相信您想要的是多文档界面(MDI),有关更多信息,请参见http://msdn.microsoft.com/zh-cn/library/ms973874.aspx

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

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