简体   繁体   中英

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?
Is it possible to achieve the same or a similar effect using C# or 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!

The Essence is the IDesignerHost interface. 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.

Are you speaking about UI creating tools? Refer to http://www.icsharpcode.net/opensource/sd/ - SharpDevelop for deep dive. It's open sourse, so you'll be able to find out more details.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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