简体   繁体   中英

Hosting a Form's content inside of another Form?

I need to host a Windows Form inside another Form, like an iframe in HTML. However, using a Multi-Document Interface causes the Form's window controls to be rendered as well. I need only the content of the Form to be rendered. How would I do this?

Look into UserControls. They will accomplish what you want.

您为什么不将每个游戏都UserControl单独的UserControl

I have an application like this.

For the contained form, I set .TopLevel = false, the formBorderStyle to none and I also set the Dock property to Fill.

In my parent form, I have a split panel and I just add my contained form to the the panel I want it in.

I don't remember exactly why I didn't want to go with UserControls any more, it was years ago. I seem to recall having a reason though. Some of my contained forms use UserControls.

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