从C#的形式推出VB窗体 [英] Launch VB form from a C# form

查看:237
本文介绍了从C#的形式推出VB窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个朋友和我正在处理类的项目。他喜欢VB和我喜欢C#,所以我们只是做了我们的事。现在,我们正在考虑合并的项目。我加了他为我的,但我找不到如何打开他从我所做的形式作出的形式。

A friend of mine and me were working on a project for class. He prefers VB and I prefer C#, so we just did our thing. Now, we were thinking of merging the projects. I added his into mine, but I can't find how to open the forms he has made from the forms I made.

有什么办法来启动VB的形式从一个C#形式?

Is there any way to launch VB forms from a C# form?

推荐答案

这是不可能在VB混合C#。但你可以使用乔恩斯基特建议的方法。

It is not possible to mix C# in VB. but you can use approach suggested by Jon Skeet.

1)的创建多项目解决方案

  • How to: Create Multi-Project Solutions

2)添加你的朋友的VB项目的参考项目中的

2) Add Reference of your friend's VB project in your project

  • How to: Add a Project Reference to a Visual Studio Web Project

然后你就可以创建你的朋友,因为在这些形式的对象:

Then you can create object of those forms that your friend created as:

YourFriendProject.SomeForm  someForm = new YourFriendProject.SomeForm();
someForm.Show();

这篇关于从C#的形式推出VB窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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