如何将C#窗口(窗体)句柄传递给VB6项目或表单? [英] How to pass a C# window(form) handle to a VB6 project or form?

查看:145
本文介绍了如何将C#窗口(窗体)句柄传递给VB6项目或表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

We have an application where we launch a VB modal dialog from a c# form on a button click. Even though the VB dialog is a modal window we are able to go back to C# dialog on click and then the application hangs.

Looks like the VB6 form does not have a parent and hence the issue. So we decided to pass the form handle from c# to VB and make our c# dialog as a parent to the VB dialog. Any help or a sample code would be really appreciated. Thanks.

推荐答案

好吧,VB6的一个可选参数 Form.Show方法 [ ^ ]是拥有表单的STRING表示。我不知道你将如何从C#中使用它,或者它是否可能。



说真的,用C#重写愚蠢的形式并保存所有的尝试与VB6互操作的麻烦。
Well, one of the optional parameters of the the VB6 Form.Show method[^] was a STRING representation of the owning form. I have no idea how you're going to use this from C#, or if it's even possible.

Seriously, rewrite the stupid form in C# and save yourself all the trouble of trying to interop with VB6.


这篇关于如何将C#窗口(窗体)句柄传递给VB6项目或表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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