一个winform内嵌入一个winform(C#) [英] Embedding a winform within a winform (c#)

查看:134
本文介绍了一个winform内嵌入一个winform(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在另一个窗口的形式嵌入Windows窗体?

Is it possible to embed a windows form within another windows form?

我已经创建了Visual Studio中的所有相关行为沿窗的形式。

I have created a windows form in Visual Studio along with all its associated behaviour.

我现在要创建一个包含标签另外一个Windows窗体,我想嵌入的第一个Windows组建成标签视图。这可能吗?

I now want to create another windows form containing a tab view, and I want to embed the first windows form into the tab view. Is this possible?

推荐答案

不能直接。您可以创建一个用户控件,将所有的代码从形式到用户控件,并在这两种形式使用。您可能需要一些代码更改从表单,但可能并不多。

Not directly. You can create a usercontrol, move all of the code from your form to the usercontrol and use this in both forms. You might need to change some of the code from your form but probably not much.

这篇关于一个winform内嵌入一个winform(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆