Contain a VB6 form in a .Net MDI

可紊 提交于 2019-11-29 12:07:39

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

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

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.

Sorry, I posted too soon here's the solution:

Embedding of VB6 form in .NET applications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!