包含在.NET MDI VB6的形式 [英] Contain a VB6 form in a .Net MDI

查看:146
本文介绍了包含在.NET MDI VB6的形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我移植一个旧VB6应用程序为净但是有VB6的形式是太大,在此版本中迁移。

I'm porting an old VB6 app into .Net but one Vb6 form is too big to migrate in this release.

我壳牌VB6的exe文件,以显示从.net VB6的形式,但VB6的形式是不包含在净MDI。我有一种感觉:它不可能为嵌入在.NET MDI VB6的形式,没有人知道这是可能的吗?

I Shell the Vb6 exe to show the VB6 form from .Net, but the VB6 form is not contained in the .Net MDI. I have a gut feeling its not possible to embed the VB6 form in the .NET MDI, does anyone know if this is possible?

我喜欢的东西后,我的Interop表单工具包2.1 甚至一个API

I'm after something like Interop Forms Toolkit 2.1 or even an API

推荐答案

这确实是可能的。这只是既不简单,也不是特别的好主意......

It is indeed possible. It's just neither simple, nor a particularly a good idea...

您需要创建一个ActiveX容器的形式,然后你就可以嵌入VB 6的形式进入。请参见这篇文章$ C $的CProject的详细信息:中嵌入的VB6形式.NET应用程序

You'll need to create an ActiveX container for the form, which you can then embed the VB 6 form into. See this article on CodeProject for details: Embedding of VB6 form in .NET applications

另一种可能(和显著简单的​​方法)可能是设置你的VB 6的形式作为.NET MDI容器父。我没有真正知道这是否会工作(我从来没有尝试过),但它是值得一试。你需要的P / Invoke的 的FindWindow 功能以获取句柄到你的VB 6窗体窗口,还有的 的setparent 功能以改变它的父窗口。

Another possible (and significantly simpler approach) might be to set the parent of your VB 6 form as the .NET MDI container. I'm not actually sure if this will work (I've never tried it), but it's worth a shot. You'll need to P/Invoke the FindWindow function to get the handle to your VB 6 form window, as well as the SetParent function to change its parent window.

这篇关于包含在.NET MDI VB6的形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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